(function(){function Timer(opt_start) {
  this.t = {};
  this.tick = function $this$tick$(label, opt_from, opt_value) {
    var value = void 0 != opt_value ? opt_value : (new Date).getTime();
    this.t[label] = [value, opt_from]
  };
  this.tick("start", null, opt_start)
}
var loadTimer = new Timer;
window.jstiming = {Timer:Timer, load:loadTimer};
try {
  var pageT = null;
  window.chrome && window.chrome.csi && (pageT = Math.floor(window.chrome.csi().pageT));
  null == pageT && window.gtbExternal && (pageT = window.gtbExternal.pageT());
  null == pageT && window.external && (pageT = window.external.pageT);
  pageT && (window.jstiming.pt = pageT)
}catch(e$$8) {
}
;var goog = goog || {};
goog.global = this;
goog.DEBUG = !0;
goog.LOCALE = "en";
goog.provide = function $goog$provide$(name) {
  goog.exportPath_(name)
};
goog.setTestOnly = function $goog$setTestOnly$(opt_message) {
  if(!goog.DEBUG) {
    throw opt_message = opt_message || "", Error("Importing test-only code into non-debug environment" + opt_message ? ": " + opt_message : ".");
  }
};
goog.exportPath_ = function $goog$exportPath_$(name, opt_object, opt_objectToExportTo) {
  var parts = name.split("."), cur = opt_objectToExportTo || goog.global;
  !(parts[0] in cur) && cur.execScript && cur.execScript("var " + parts[0]);
  for(var part;parts.length && (part = parts.shift());) {
    !parts.length && goog.isDef(opt_object) ? cur[part] = opt_object : cur = cur[part] ? cur[part] : cur[part] = {}
  }
};
goog.getObjectByName = function $goog$getObjectByName$(name, opt_obj) {
  for(var parts = name.split("."), cur = opt_obj || goog.global, part;part = parts.shift();) {
    if(goog.isDefAndNotNull(cur[part])) {
      cur = cur[part]
    }else {
      return null
    }
  }
  return cur
};
goog.globalize = function $goog$globalize$(obj, opt_global) {
  var global = opt_global || goog.global, x;
  for(x in obj) {
    global[x] = obj[x]
  }
};
goog.addDependency = function $goog$addDependency$() {
};
goog.useStrictRequires = !1;
goog.ENABLE_DEBUG_LOADER = !0;
goog.require = function $goog$require$() {
};
goog.basePath = "";
goog.nullFunction = function $goog$nullFunction$() {
};
goog.identityFunction = function $goog$identityFunction$(opt_returnValue) {
  return opt_returnValue
};
goog.abstractMethod = function $goog$abstractMethod$() {
  throw Error("unimplemented abstract method");
};
goog.addSingletonGetter = function $goog$addSingletonGetter$(ctor) {
  ctor.getInstance = function $ctor$getInstance$() {
    if(ctor.instance_) {
      return ctor.instance_
    }
    goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = ctor);
    return ctor.instance_ = new ctor
  }
};
goog.instantiatedSingletons_ = [];
goog.typeOf = function $goog$typeOf$(value) {
  var s = typeof value;
  if("object" == s) {
    if(value) {
      if(value instanceof Array) {
        return"array"
      }
      if(value instanceof Object) {
        return s
      }
      var className = Object.prototype.toString.call(value);
      if("[object Window]" == className) {
        return"object"
      }
      if("[object Array]" == className || "number" == typeof value.length && "undefined" != typeof value.splice && "undefined" != typeof value.propertyIsEnumerable && !value.propertyIsEnumerable("splice")) {
        return"array"
      }
      if("[object Function]" == className || "undefined" != typeof value.call && "undefined" != typeof value.propertyIsEnumerable && !value.propertyIsEnumerable("call")) {
        return"function"
      }
    }else {
      return"null"
    }
  }else {
    if("function" == s && "undefined" == typeof value.call) {
      return"object"
    }
  }
  return s
};
goog.isDef = function $goog$isDef$(val) {
  return void 0 !== val
};
goog.isNull = function $goog$isNull$(val) {
  return null === val
};
goog.isDefAndNotNull = function $goog$isDefAndNotNull$(val) {
  return null != val
};
goog.isArray = function $goog$isArray$(val) {
  return"array" == goog.typeOf(val)
};
goog.isArrayLike = function $goog$isArrayLike$(val) {
  var type = goog.typeOf(val);
  return"array" == type || "object" == type && "number" == typeof val.length
};
goog.isDateLike = function $goog$isDateLike$(val) {
  return goog.isObject(val) && "function" == typeof val.getFullYear
};
goog.isString = function $goog$isString$(val) {
  return"string" == typeof val
};
goog.isBoolean = function $goog$isBoolean$(val) {
  return"boolean" == typeof val
};
goog.isNumber = function $goog$isNumber$(val) {
  return"number" == typeof val
};
goog.isFunction = function $goog$isFunction$(val) {
  return"function" == goog.typeOf(val)
};
goog.isObject = function $goog$isObject$(val) {
  var type = typeof val;
  return"object" == type && null != val || "function" == type
};
goog.getUid = function $goog$getUid$(obj) {
  return obj[goog.UID_PROPERTY_] || (obj[goog.UID_PROPERTY_] = ++goog.uidCounter_)
};
goog.removeUid = function $goog$removeUid$(obj) {
  "removeAttribute" in obj && obj.removeAttribute(goog.UID_PROPERTY_);
  try {
    delete obj[goog.UID_PROPERTY_]
  }catch(ex) {
  }
};
goog.UID_PROPERTY_ = "closure_uid_" + Math.floor(2147483648 * Math.random()).toString(36);
goog.uidCounter_ = 0;
goog.getHashCode = goog.getUid;
goog.removeHashCode = goog.removeUid;
goog.cloneObject = function $goog$cloneObject$(obj) {
  var type = goog.typeOf(obj);
  if("object" == type || "array" == type) {
    if(obj.clone) {
      return obj.clone()
    }
    var clone = "array" == type ? [] : {}, key;
    for(key in obj) {
      clone[key] = goog.cloneObject(obj[key])
    }
    return clone
  }
  return obj
};
goog.bindNative_ = function $goog$bindNative_$(fn, selfObj, var_args) {
  return fn.call.apply(fn.bind, arguments)
};
goog.bindJs_ = function $goog$bindJs_$(fn, selfObj, var_args) {
  if(!fn) {
    throw Error();
  }
  if(2 < arguments.length) {
    var boundArgs = Array.prototype.slice.call(arguments, 2);
    return function() {
      var newArgs = Array.prototype.slice.call(arguments);
      Array.prototype.unshift.apply(newArgs, boundArgs);
      return fn.apply(selfObj, newArgs)
    }
  }
  return function() {
    return fn.apply(selfObj, arguments)
  }
};
goog.bind = function $goog$bind$(fn, selfObj, var_args) {
  goog.bind = Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? goog.bindNative_ : goog.bindJs_;
  return goog.bind.apply(null, arguments)
};
goog.partial = function $goog$partial$(fn, var_args) {
  var args = Array.prototype.slice.call(arguments, 1);
  return function() {
    var newArgs = Array.prototype.slice.call(arguments);
    newArgs.unshift.apply(newArgs, args);
    return fn.apply(this, newArgs)
  }
};
goog.mixin = function $goog$mixin$(target, source) {
  for(var x in source) {
    target[x] = source[x]
  }
};
goog.now = Date.now || function() {
  return+new Date
};
goog.globalEval = function $goog$globalEval$(script) {
  if(goog.global.execScript) {
    goog.global.execScript(script, "JavaScript")
  }else {
    if(goog.global.eval) {
      if(null == goog.evalWorksForGlobals_ && (goog.global.eval("var _et_ = 1;"), "undefined" != typeof goog.global._et_ ? (delete goog.global._et_, goog.evalWorksForGlobals_ = !0) : goog.evalWorksForGlobals_ = !1), goog.evalWorksForGlobals_) {
        goog.global.eval(script)
      }else {
        var doc = goog.global.document, scriptElt = doc.createElement("script");
        scriptElt.type = "text/javascript";
        scriptElt.defer = !1;
        scriptElt.appendChild(doc.createTextNode(script));
        doc.body.appendChild(scriptElt);
        doc.body.removeChild(scriptElt)
      }
    }else {
      throw Error("goog.globalEval not available");
    }
  }
};
goog.evalWorksForGlobals_ = null;
goog.getCssName = function $goog$getCssName$(className, opt_modifier) {
  var getMapping = function $getMapping$(cssName) {
    return goog.cssNameMapping_[cssName] || cssName
  }, renameByParts = function $renameByParts$(cssName) {
    for(var parts = cssName.split("-"), mapped = [], i = 0;i < parts.length;i++) {
      mapped.push(getMapping(parts[i]))
    }
    return mapped.join("-")
  }, rename;
  rename = goog.cssNameMapping_ ? "BY_WHOLE" == goog.cssNameMappingStyle_ ? getMapping : renameByParts : function(a) {
    return a
  };
  return opt_modifier ? className + "-" + rename(opt_modifier) : rename(className)
};
goog.setCssNameMapping = function $goog$setCssNameMapping$(mapping, opt_style) {
  goog.cssNameMapping_ = mapping;
  goog.cssNameMappingStyle_ = opt_style
};
goog.getMsg = function $goog$getMsg$(str, opt_values) {
  var values = opt_values || {}, key;
  for(key in values) {
    var value = ("" + values[key]).replace(/\$/g, "$$$$"), str = str.replace(RegExp("\\{\\$" + key + "\\}", "gi"), value)
  }
  return str
};
goog.exportSymbol = function $goog$exportSymbol$(publicPath, object, opt_objectToExportTo) {
  goog.exportPath_(publicPath, object, opt_objectToExportTo)
};
goog.exportProperty = function $goog$exportProperty$(object, publicName, symbol) {
  object[publicName] = symbol
};
goog.inherits = function $goog$inherits$(childCtor, parentCtor) {
  function tempCtor() {
  }
  tempCtor.prototype = parentCtor.prototype;
  childCtor.superClass_ = parentCtor.prototype;
  childCtor.prototype = new tempCtor;
  childCtor.prototype.constructor = childCtor
};
goog.base = function $goog$base$(me, opt_methodName, var_args) {
  var caller = arguments.callee.caller;
  if(caller.superClass_) {
    return caller.superClass_.constructor.apply(me, Array.prototype.slice.call(arguments, 1))
  }
  for(var args = Array.prototype.slice.call(arguments, 2), foundCaller = !1, ctor = me.constructor;ctor;ctor = ctor.superClass_ && ctor.superClass_.constructor) {
    if(ctor.prototype[opt_methodName] === caller) {
      foundCaller = !0
    }else {
      if(foundCaller) {
        return ctor.prototype[opt_methodName].apply(me, args)
      }
    }
  }
  if(me[opt_methodName] === caller) {
    return me.constructor.prototype[opt_methodName].apply(me, args)
  }
  throw Error("goog.base called from a method of one name to a method of a different name");
};
goog.scope = function $goog$scope$(fn) {
  fn.call(goog.global)
};
goog.MODIFY_FUNCTION_PROTOTYPES = !0;
goog.MODIFY_FUNCTION_PROTOTYPES && (Function.prototype.bind = Function.prototype.bind || function(selfObj, var_args) {
  if(1 < arguments.length) {
    var args = Array.prototype.slice.call(arguments, 1);
    args.unshift(this, selfObj);
    return goog.bind.apply(null, args)
  }
  return goog.bind(this, selfObj)
}, Function.prototype.partial = function $Function$$partial$(var_args) {
  var args = Array.prototype.slice.call(arguments);
  args.unshift(this, null);
  return goog.bind.apply(null, args)
}, Function.prototype.inherits = function $Function$$inherits$(parentCtor) {
  goog.inherits(this, parentCtor)
}, Function.prototype.mixin = function $Function$$mixin$(source) {
  goog.mixin(this.prototype, source)
});
goog.debug = {};
goog.debug.Error = function $goog$debug$Error$(opt_msg) {
  this.stack = Error().stack || "";
  opt_msg && (this.message = "" + opt_msg)
};
goog.inherits(goog.debug.Error, Error);
goog.debug.Error.prototype.name = "CustomError";
goog.string = {};
goog.string.Unicode = {NBSP:"\u00a0"};
goog.string.startsWith = function $goog$string$startsWith$(str, prefix) {
  return 0 == str.lastIndexOf(prefix, 0)
};
goog.string.endsWith = function $goog$string$endsWith$(str, suffix) {
  var l = str.length - suffix.length;
  return 0 <= l && str.indexOf(suffix, l) == l
};
goog.string.caseInsensitiveStartsWith = function $goog$string$caseInsensitiveStartsWith$(str, prefix) {
  return 0 == goog.string.caseInsensitiveCompare(prefix, str.substr(0, prefix.length))
};
goog.string.caseInsensitiveEndsWith = function $goog$string$caseInsensitiveEndsWith$(str, suffix) {
  return 0 == goog.string.caseInsensitiveCompare(suffix, str.substr(str.length - suffix.length, suffix.length))
};
goog.string.subs = function $goog$string$subs$(str, var_args) {
  for(var i = 1;i < arguments.length;i++) {
    var replacement = ("" + arguments[i]).replace(/\$/g, "$$$$"), str = str.replace(/\%s/, replacement)
  }
  return str
};
goog.string.collapseWhitespace = function $goog$string$collapseWhitespace$(str) {
  return str.replace(/[\s\xa0]+/g, " ").replace(/^\s+|\s+$/g, "")
};
goog.string.isEmpty = function $goog$string$isEmpty$(str) {
  return/^[\s\xa0]*$/.test(str)
};
goog.string.isEmptySafe = function $goog$string$isEmptySafe$(str) {
  return goog.string.isEmpty(goog.string.makeSafe(str))
};
goog.string.isBreakingWhitespace = function $goog$string$isBreakingWhitespace$(str) {
  return!/[^\t\n\r ]/.test(str)
};
goog.string.isAlpha = function $goog$string$isAlpha$(str) {
  return!/[^a-zA-Z]/.test(str)
};
goog.string.isNumeric = function $goog$string$isNumeric$(str) {
  return!/[^0-9]/.test(str)
};
goog.string.isAlphaNumeric = function $goog$string$isAlphaNumeric$(str) {
  return!/[^a-zA-Z0-9]/.test(str)
};
goog.string.isSpace = function $goog$string$isSpace$(ch) {
  return" " == ch
};
goog.string.isUnicodeChar = function $goog$string$isUnicodeChar$(ch) {
  return 1 == ch.length && " " <= ch && "~" >= ch || "\u0080" <= ch && "\ufffd" >= ch
};
goog.string.stripNewlines = function $goog$string$stripNewlines$(str) {
  return str.replace(/(\r\n|\r|\n)+/g, " ")
};
goog.string.canonicalizeNewlines = function $goog$string$canonicalizeNewlines$(str) {
  return str.replace(/(\r\n|\r|\n)/g, "\n")
};
goog.string.normalizeWhitespace = function $goog$string$normalizeWhitespace$(str) {
  return str.replace(/\xa0|\s/g, " ")
};
goog.string.normalizeSpaces = function $goog$string$normalizeSpaces$(str) {
  return str.replace(/\xa0|[ \t]+/g, " ")
};
goog.string.collapseBreakingSpaces = function $goog$string$collapseBreakingSpaces$(str) {
  return str.replace(/[\t\r\n ]+/g, " ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, "")
};
goog.string.trim = function $goog$string$trim$(str) {
  return str.replace(/^[\s\xa0]+|[\s\xa0]+$/g, "")
};
goog.string.trimLeft = function $goog$string$trimLeft$(str) {
  return str.replace(/^[\s\xa0]+/, "")
};
goog.string.trimRight = function $goog$string$trimRight$(str) {
  return str.replace(/[\s\xa0]+$/, "")
};
goog.string.caseInsensitiveCompare = function $goog$string$caseInsensitiveCompare$(str1, str2) {
  var test1 = ("" + str1).toLowerCase(), test2 = ("" + str2).toLowerCase();
  return test1 < test2 ? -1 : test1 == test2 ? 0 : 1
};
goog.string.numerateCompareRegExp_ = /(\.\d+)|(\d+)|(\D+)/g;
goog.string.numerateCompare = function $goog$string$numerateCompare$(str1, str2) {
  if(str1 == str2) {
    return 0
  }
  if(!str1) {
    return-1
  }
  if(!str2) {
    return 1
  }
  for(var tokens1 = str1.toLowerCase().match(goog.string.numerateCompareRegExp_), tokens2 = str2.toLowerCase().match(goog.string.numerateCompareRegExp_), count = Math.min(tokens1.length, tokens2.length), i = 0;i < count;i++) {
    var a = tokens1[i], b = tokens2[i];
    if(a != b) {
      var num1 = parseInt(a, 10);
      if(!isNaN(num1)) {
        var num2 = parseInt(b, 10);
        if(!isNaN(num2) && num1 - num2) {
          return num1 - num2
        }
      }
      return a < b ? -1 : 1
    }
  }
  return tokens1.length != tokens2.length ? tokens1.length - tokens2.length : str1 < str2 ? -1 : 1
};
goog.string.encodeUriRegExp_ = /^[a-zA-Z0-9\-_.!~*'()]*$/;
goog.string.urlEncode = function $goog$string$urlEncode$(str) {
  str = "" + str;
  return!goog.string.encodeUriRegExp_.test(str) ? encodeURIComponent(str) : str
};
goog.string.urlDecode = function $goog$string$urlDecode$(str) {
  return decodeURIComponent(str.replace(/\+/g, " "))
};
goog.string.newLineToBr = function $goog$string$newLineToBr$(str, opt_xml) {
  return str.replace(/(\r\n|\r|\n)/g, opt_xml ? "<br />" : "<br>")
};
goog.string.htmlEscape = function $goog$string$htmlEscape$(str, opt_isLikelyToContainHtmlChars) {
  if(opt_isLikelyToContainHtmlChars) {
    return str.replace(goog.string.amperRe_, "&amp;").replace(goog.string.ltRe_, "&lt;").replace(goog.string.gtRe_, "&gt;").replace(goog.string.quotRe_, "&quot;")
  }
  if(!goog.string.allRe_.test(str)) {
    return str
  }
  -1 != str.indexOf("&") && (str = str.replace(goog.string.amperRe_, "&amp;"));
  -1 != str.indexOf("<") && (str = str.replace(goog.string.ltRe_, "&lt;"));
  -1 != str.indexOf(">") && (str = str.replace(goog.string.gtRe_, "&gt;"));
  -1 != str.indexOf('"') && (str = str.replace(goog.string.quotRe_, "&quot;"));
  return str
};
goog.string.amperRe_ = /&/g;
goog.string.ltRe_ = /</g;
goog.string.gtRe_ = />/g;
goog.string.quotRe_ = /\"/g;
goog.string.allRe_ = /[&<>\"]/;
goog.string.unescapeEntities = function $goog$string$unescapeEntities$(str) {
  return goog.string.contains(str, "&") ? "document" in goog.global ? goog.string.unescapeEntitiesUsingDom_(str) : goog.string.unescapePureXmlEntities_(str) : str
};
goog.string.unescapeEntitiesUsingDom_ = function $goog$string$unescapeEntitiesUsingDom_$(str) {
  var seen = {"&amp;":"&", "&lt;":"<", "&gt;":">", "&quot;":'"'}, div = document.createElement("div");
  return str.replace(goog.string.HTML_ENTITY_PATTERN_, function(s, entity) {
    var value = seen[s];
    if(value) {
      return value
    }
    if("#" == entity.charAt(0)) {
      var n = Number("0" + entity.substr(1));
      isNaN(n) || (value = String.fromCharCode(n))
    }
    value || (div.innerHTML = s + " ", value = div.firstChild.nodeValue.slice(0, -1));
    return seen[s] = value
  })
};
goog.string.unescapePureXmlEntities_ = function $goog$string$unescapePureXmlEntities_$(str) {
  return str.replace(/&([^;]+);/g, function(s, entity) {
    switch(entity) {
      case "amp":
        return"&";
      case "lt":
        return"<";
      case "gt":
        return">";
      case "quot":
        return'"';
      default:
        if("#" == entity.charAt(0)) {
          var n = Number("0" + entity.substr(1));
          if(!isNaN(n)) {
            return String.fromCharCode(n)
          }
        }
        return s
    }
  })
};
goog.string.HTML_ENTITY_PATTERN_ = /&([^;\s<&]+);?/g;
goog.string.whitespaceEscape = function $goog$string$whitespaceEscape$(str, opt_xml) {
  return goog.string.newLineToBr(str.replace(/  /g, " &#160;"), opt_xml)
};
goog.string.stripQuotes = function $goog$string$stripQuotes$(str, quoteChars) {
  for(var length = quoteChars.length, i = 0;i < length;i++) {
    var quoteChar = 1 == length ? quoteChars : quoteChars.charAt(i);
    if(str.charAt(0) == quoteChar && str.charAt(str.length - 1) == quoteChar) {
      return str.substring(1, str.length - 1)
    }
  }
  return str
};
goog.string.truncate = function $goog$string$truncate$(str, chars, opt_protectEscapedCharacters) {
  opt_protectEscapedCharacters && (str = goog.string.unescapeEntities(str));
  str.length > chars && (str = str.substring(0, chars - 3) + "...");
  opt_protectEscapedCharacters && (str = goog.string.htmlEscape(str));
  return str
};
goog.string.truncateMiddle = function $goog$string$truncateMiddle$(str, chars, opt_protectEscapedCharacters, opt_trailingChars) {
  opt_protectEscapedCharacters && (str = goog.string.unescapeEntities(str));
  if(opt_trailingChars && str.length > chars) {
    opt_trailingChars > chars && (opt_trailingChars = chars);
    var endPoint = str.length - opt_trailingChars, startPoint = chars - opt_trailingChars, str = str.substring(0, startPoint) + "..." + str.substring(endPoint)
  }else {
    if(str.length > chars) {
      var half = Math.floor(chars / 2), endPos = str.length - half, half = half + chars % 2, str = str.substring(0, half) + "..." + str.substring(endPos)
    }
  }
  opt_protectEscapedCharacters && (str = goog.string.htmlEscape(str));
  return str
};
goog.string.specialEscapeChars_ = {"\x00":"\\0", "\u0008":"\\b", "\u000c":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t", "\x0B":"\\x0B", '"':'\\"', "\\":"\\\\"};
goog.string.jsEscapeCache_ = {"'":"\\'"};
goog.string.quote = function $goog$string$quote$(s) {
  s = "" + s;
  if(s.quote) {
    return s.quote()
  }
  for(var sb = ['"'], i = 0;i < s.length;i++) {
    var ch = s.charAt(i), cc = ch.charCodeAt(0);
    sb[i + 1] = goog.string.specialEscapeChars_[ch] || (31 < cc && 127 > cc ? ch : goog.string.escapeChar(ch))
  }
  sb.push('"');
  return sb.join("")
};
goog.string.escapeString = function $goog$string$escapeString$(str) {
  for(var sb = [], i = 0;i < str.length;i++) {
    sb[i] = goog.string.escapeChar(str.charAt(i))
  }
  return sb.join("")
};
goog.string.escapeChar = function $goog$string$escapeChar$(c) {
  if(c in goog.string.jsEscapeCache_) {
    return goog.string.jsEscapeCache_[c]
  }
  if(c in goog.string.specialEscapeChars_) {
    return goog.string.jsEscapeCache_[c] = goog.string.specialEscapeChars_[c]
  }
  var rv = c, cc = c.charCodeAt(0);
  if(31 < cc && 127 > cc) {
    rv = c
  }else {
    if(256 > cc) {
      if(rv = "\\x", 16 > cc || 256 < cc) {
        rv += "0"
      }
    }else {
      rv = "\\u", 4096 > cc && (rv += "0")
    }
    rv += cc.toString(16).toUpperCase()
  }
  return goog.string.jsEscapeCache_[c] = rv
};
goog.string.toMap = function $goog$string$toMap$(s) {
  for(var rv = {}, i = 0;i < s.length;i++) {
    rv[s.charAt(i)] = !0
  }
  return rv
};
goog.string.contains = function $goog$string$contains$(s, ss) {
  return-1 != s.indexOf(ss)
};
goog.string.countOf = function $goog$string$countOf$(s, ss) {
  return s && ss ? s.split(ss).length - 1 : 0
};
goog.string.removeAt = function $goog$string$removeAt$(s, index, stringLength) {
  var resultStr = s;
  0 <= index && index < s.length && 0 < stringLength && (resultStr = s.substr(0, index) + s.substr(index + stringLength, s.length - index - stringLength));
  return resultStr
};
goog.string.remove = function $goog$string$remove$(s, ss) {
  var re = RegExp(goog.string.regExpEscape(ss), "");
  return s.replace(re, "")
};
goog.string.removeAll = function $goog$string$removeAll$(s, ss) {
  var re = RegExp(goog.string.regExpEscape(ss), "g");
  return s.replace(re, "")
};
goog.string.regExpEscape = function $goog$string$regExpEscape$(s) {
  return("" + s).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1").replace(/\x08/g, "\\x08")
};
goog.string.repeat = function $goog$string$repeat$(string, length) {
  return Array(length + 1).join(string)
};
goog.string.padNumber = function $goog$string$padNumber$(num, length, opt_precision) {
  var s = goog.isDef(opt_precision) ? num.toFixed(opt_precision) : "" + num, index = s.indexOf(".");
  -1 == index && (index = s.length);
  return goog.string.repeat("0", Math.max(0, length - index)) + s
};
goog.string.makeSafe = function $goog$string$makeSafe$(obj) {
  return null == obj ? "" : "" + obj
};
goog.string.buildString = function $goog$string$buildString$(var_args) {
  return Array.prototype.join.call(arguments, "")
};
goog.string.getRandomString = function $goog$string$getRandomString$() {
  var x = 2147483648;
  return Math.floor(Math.random() * x).toString(36) + Math.abs(Math.floor(Math.random() * x) ^ goog.now()).toString(36)
};
goog.string.compareVersions = function $goog$string$compareVersions$(version1, version2) {
  for(var order = 0, v1Subs = goog.string.trim("" + version1).split("."), v2Subs = goog.string.trim("" + version2).split("."), subCount = Math.max(v1Subs.length, v2Subs.length), subIdx = 0;0 == order && subIdx < subCount;subIdx++) {
    var v1Sub = v1Subs[subIdx] || "", v2Sub = v2Subs[subIdx] || "", v1CompParser = RegExp("(\\d*)(\\D*)", "g"), v2CompParser = RegExp("(\\d*)(\\D*)", "g");
    do {
      var v1Comp = v1CompParser.exec(v1Sub) || ["", "", ""], v2Comp = v2CompParser.exec(v2Sub) || ["", "", ""];
      if(0 == v1Comp[0].length && 0 == v2Comp[0].length) {
        break
      }
      var v1CompNum = 0 == v1Comp[1].length ? 0 : parseInt(v1Comp[1], 10), v2CompNum = 0 == v2Comp[1].length ? 0 : parseInt(v2Comp[1], 10), order = goog.string.compareElements_(v1CompNum, v2CompNum) || goog.string.compareElements_(0 == v1Comp[2].length, 0 == v2Comp[2].length) || goog.string.compareElements_(v1Comp[2], v2Comp[2])
    }while(0 == order)
  }
  return order
};
goog.string.compareElements_ = function $goog$string$compareElements_$(left, right) {
  return left < right ? -1 : left > right ? 1 : 0
};
goog.string.HASHCODE_MAX_ = 4294967296;
goog.string.hashCode = function $goog$string$hashCode$(str) {
  for(var result = 0, i = 0;i < str.length;++i) {
    result = 31 * result + str.charCodeAt(i), result %= goog.string.HASHCODE_MAX_
  }
  return result
};
goog.string.uniqueStringCounter_ = 2147483648 * Math.random() | 0;
goog.string.createUniqueString = function $goog$string$createUniqueString$() {
  return"goog_" + goog.string.uniqueStringCounter_++
};
goog.string.toNumber = function $goog$string$toNumber$(str) {
  var num = Number(str);
  return 0 == num && goog.string.isEmpty(str) ? NaN : num
};
goog.string.toCamelCaseCache_ = {};
goog.string.toCamelCase = function $goog$string$toCamelCase$(str) {
  return goog.string.toCamelCaseCache_[str] || (goog.string.toCamelCaseCache_[str] = ("" + str).replace(/\-([a-z])/g, function(all, match) {
    return match.toUpperCase()
  }))
};
goog.string.toSelectorCaseCache_ = {};
goog.string.toSelectorCase = function $goog$string$toSelectorCase$(str) {
  return goog.string.toSelectorCaseCache_[str] || (goog.string.toSelectorCaseCache_[str] = ("" + str).replace(/([A-Z])/g, "-$1").toLowerCase())
};
goog.asserts = {};
goog.asserts.ENABLE_ASSERTS = goog.DEBUG;
goog.asserts.AssertionError = function $goog$asserts$AssertionError$(messagePattern, messageArgs) {
  messageArgs.unshift(messagePattern);
  goog.debug.Error.call(this, goog.string.subs.apply(null, messageArgs));
  messageArgs.shift()
};
goog.inherits(goog.asserts.AssertionError, goog.debug.Error);
goog.asserts.AssertionError.prototype.name = "AssertionError";
goog.asserts.doAssertFailure_ = function $goog$asserts$doAssertFailure_$(defaultMessage, defaultArgs, givenMessage, givenArgs) {
  var message = "Assertion failed";
  if(givenMessage) {
    var message = message + (": " + givenMessage), args = givenArgs
  }else {
    defaultMessage && (message += ": " + defaultMessage, args = defaultArgs)
  }
  throw new goog.asserts.AssertionError("" + message, args || []);
};
goog.asserts.assert = function $goog$asserts$assert$(condition, opt_message, var_args) {
  goog.asserts.ENABLE_ASSERTS && !condition && goog.asserts.doAssertFailure_("", null, opt_message, Array.prototype.slice.call(arguments, 2));
  return condition
};
goog.asserts.fail = function $goog$asserts$fail$(opt_message, var_args) {
  if(goog.asserts.ENABLE_ASSERTS) {
    throw new goog.asserts.AssertionError("Failure" + (opt_message ? ": " + opt_message : ""), Array.prototype.slice.call(arguments, 1));
  }
};
goog.asserts.assertNumber = function $goog$asserts$assertNumber$(value, opt_message, var_args) {
  goog.asserts.ENABLE_ASSERTS && !goog.isNumber(value) && goog.asserts.doAssertFailure_("Expected number but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
  return value
};
goog.asserts.assertString = function $goog$asserts$assertString$(value, opt_message, var_args) {
  goog.asserts.ENABLE_ASSERTS && !goog.isString(value) && goog.asserts.doAssertFailure_("Expected string but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
  return value
};
goog.asserts.assertFunction = function $goog$asserts$assertFunction$(value, opt_message, var_args) {
  goog.asserts.ENABLE_ASSERTS && !goog.isFunction(value) && goog.asserts.doAssertFailure_("Expected function but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
  return value
};
goog.asserts.assertObject = function $goog$asserts$assertObject$(value, opt_message, var_args) {
  goog.asserts.ENABLE_ASSERTS && !goog.isObject(value) && goog.asserts.doAssertFailure_("Expected object but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
  return value
};
goog.asserts.assertArray = function $goog$asserts$assertArray$(value, opt_message, var_args) {
  goog.asserts.ENABLE_ASSERTS && !goog.isArray(value) && goog.asserts.doAssertFailure_("Expected array but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
  return value
};
goog.asserts.assertBoolean = function $goog$asserts$assertBoolean$(value, opt_message, var_args) {
  goog.asserts.ENABLE_ASSERTS && !goog.isBoolean(value) && goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
  return value
};
goog.asserts.assertInstanceof = function $goog$asserts$assertInstanceof$(value, type, opt_message, var_args) {
  goog.asserts.ENABLE_ASSERTS && !(value instanceof type) && goog.asserts.doAssertFailure_("instanceof check failed.", null, opt_message, Array.prototype.slice.call(arguments, 3))
};
goog.array = {};
goog.NATIVE_ARRAY_PROTOTYPES = !1;
goog.array.peek = function $goog$array$peek$(array) {
  return array[array.length - 1]
};
goog.array.ARRAY_PROTOTYPE_ = Array.prototype;
goog.array.indexOf = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.indexOf ? function(arr, obj, opt_fromIndex) {
  goog.asserts.assert(null != arr.length);
  return goog.array.ARRAY_PROTOTYPE_.indexOf.call(arr, obj, opt_fromIndex)
} : function(arr, obj, opt_fromIndex) {
  var fromIndex = null == opt_fromIndex ? 0 : 0 > opt_fromIndex ? Math.max(0, arr.length + opt_fromIndex) : opt_fromIndex;
  if(goog.isString(arr)) {
    return!goog.isString(obj) || 1 != obj.length ? -1 : arr.indexOf(obj, fromIndex)
  }
  for(var i = fromIndex;i < arr.length;i++) {
    if(i in arr && arr[i] === obj) {
      return i
    }
  }
  return-1
};
goog.array.lastIndexOf = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.lastIndexOf ? function(arr, obj, opt_fromIndex) {
  goog.asserts.assert(null != arr.length);
  var fromIndex = null == opt_fromIndex ? arr.length - 1 : opt_fromIndex;
  return goog.array.ARRAY_PROTOTYPE_.lastIndexOf.call(arr, obj, fromIndex)
} : function(arr, obj, opt_fromIndex) {
  var fromIndex = null == opt_fromIndex ? arr.length - 1 : opt_fromIndex;
  0 > fromIndex && (fromIndex = Math.max(0, arr.length + fromIndex));
  if(goog.isString(arr)) {
    return!goog.isString(obj) || 1 != obj.length ? -1 : arr.lastIndexOf(obj, fromIndex)
  }
  for(var i = fromIndex;0 <= i;i--) {
    if(i in arr && arr[i] === obj) {
      return i
    }
  }
  return-1
};
goog.array.forEach = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.forEach ? function(arr, f, opt_obj) {
  goog.asserts.assert(null != arr.length);
  goog.array.ARRAY_PROTOTYPE_.forEach.call(arr, f, opt_obj)
} : function(arr, f, opt_obj) {
  for(var l = arr.length, arr2 = goog.isString(arr) ? arr.split("") : arr, i = 0;i < l;i++) {
    i in arr2 && f.call(opt_obj, arr2[i], i, arr)
  }
};
goog.array.forEachRight = function $goog$array$forEachRight$(arr, f, opt_obj) {
  for(var l = arr.length, arr2 = goog.isString(arr) ? arr.split("") : arr, i = l - 1;0 <= i;--i) {
    i in arr2 && f.call(opt_obj, arr2[i], i, arr)
  }
};
goog.array.filter = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.filter ? function(arr, f, opt_obj) {
  goog.asserts.assert(null != arr.length);
  return goog.array.ARRAY_PROTOTYPE_.filter.call(arr, f, opt_obj)
} : function(arr, f, opt_obj) {
  for(var l = arr.length, res = [], resLength = 0, arr2 = goog.isString(arr) ? arr.split("") : arr, i = 0;i < l;i++) {
    if(i in arr2) {
      var val = arr2[i];
      f.call(opt_obj, val, i, arr) && (res[resLength++] = val)
    }
  }
  return res
};
goog.array.map = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.map ? function(arr, f, opt_obj) {
  goog.asserts.assert(null != arr.length);
  return goog.array.ARRAY_PROTOTYPE_.map.call(arr, f, opt_obj)
} : function(arr, f, opt_obj) {
  for(var l = arr.length, res = Array(l), arr2 = goog.isString(arr) ? arr.split("") : arr, i = 0;i < l;i++) {
    i in arr2 && (res[i] = f.call(opt_obj, arr2[i], i, arr))
  }
  return res
};
goog.array.reduce = function $goog$array$reduce$(arr, f, val$$0, opt_obj) {
  if(arr.reduce) {
    return opt_obj ? arr.reduce(goog.bind(f, opt_obj), val$$0) : arr.reduce(f, val$$0)
  }
  var rval = val$$0;
  goog.array.forEach(arr, function(val, index) {
    rval = f.call(opt_obj, rval, val, index, arr)
  });
  return rval
};
goog.array.reduceRight = function $goog$array$reduceRight$(arr, f, val$$0, opt_obj) {
  if(arr.reduceRight) {
    return opt_obj ? arr.reduceRight(goog.bind(f, opt_obj), val$$0) : arr.reduceRight(f, val$$0)
  }
  var rval = val$$0;
  goog.array.forEachRight(arr, function(val, index) {
    rval = f.call(opt_obj, rval, val, index, arr)
  });
  return rval
};
goog.array.some = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.some ? function(arr, f, opt_obj) {
  goog.asserts.assert(null != arr.length);
  return goog.array.ARRAY_PROTOTYPE_.some.call(arr, f, opt_obj)
} : function(arr, f, opt_obj) {
  for(var l = arr.length, arr2 = goog.isString(arr) ? arr.split("") : arr, i = 0;i < l;i++) {
    if(i in arr2 && f.call(opt_obj, arr2[i], i, arr)) {
      return!0
    }
  }
  return!1
};
goog.array.every = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.every ? function(arr, f, opt_obj) {
  goog.asserts.assert(null != arr.length);
  return goog.array.ARRAY_PROTOTYPE_.every.call(arr, f, opt_obj)
} : function(arr, f, opt_obj) {
  for(var l = arr.length, arr2 = goog.isString(arr) ? arr.split("") : arr, i = 0;i < l;i++) {
    if(i in arr2 && !f.call(opt_obj, arr2[i], i, arr)) {
      return!1
    }
  }
  return!0
};
goog.array.find = function $goog$array$find$(arr, f, opt_obj) {
  var i = goog.array.findIndex(arr, f, opt_obj);
  return 0 > i ? null : goog.isString(arr) ? arr.charAt(i) : arr[i]
};
goog.array.findIndex = function $goog$array$findIndex$(arr, f, opt_obj) {
  for(var l = arr.length, arr2 = goog.isString(arr) ? arr.split("") : arr, i = 0;i < l;i++) {
    if(i in arr2 && f.call(opt_obj, arr2[i], i, arr)) {
      return i
    }
  }
  return-1
};
goog.array.findRight = function $goog$array$findRight$(arr, f, opt_obj) {
  var i = goog.array.findIndexRight(arr, f, opt_obj);
  return 0 > i ? null : goog.isString(arr) ? arr.charAt(i) : arr[i]
};
goog.array.findIndexRight = function $goog$array$findIndexRight$(arr, f, opt_obj) {
  for(var l = arr.length, arr2 = goog.isString(arr) ? arr.split("") : arr, i = l - 1;0 <= i;i--) {
    if(i in arr2 && f.call(opt_obj, arr2[i], i, arr)) {
      return i
    }
  }
  return-1
};
goog.array.contains = function $goog$array$contains$(arr, obj) {
  return 0 <= goog.array.indexOf(arr, obj)
};
goog.array.isEmpty = function $goog$array$isEmpty$(arr) {
  return 0 == arr.length
};
goog.array.clear = function $goog$array$clear$(arr) {
  if(!goog.isArray(arr)) {
    for(var i = arr.length - 1;0 <= i;i--) {
      delete arr[i]
    }
  }
  arr.length = 0
};
goog.array.insert = function $goog$array$insert$(arr, obj) {
  goog.array.contains(arr, obj) || arr.push(obj)
};
goog.array.insertAt = function $goog$array$insertAt$(arr, obj, opt_i) {
  goog.array.splice(arr, opt_i, 0, obj)
};
goog.array.insertArrayAt = function $goog$array$insertArrayAt$(arr, elementsToAdd, opt_i) {
  goog.partial(goog.array.splice, arr, opt_i, 0).apply(null, elementsToAdd)
};
goog.array.insertBefore = function $goog$array$insertBefore$(arr, obj, opt_obj2) {
  var i;
  2 == arguments.length || 0 > (i = goog.array.indexOf(arr, opt_obj2)) ? arr.push(obj) : goog.array.insertAt(arr, obj, i)
};
goog.array.remove = function $goog$array$remove$(arr, obj) {
  var i = goog.array.indexOf(arr, obj), rv;
  (rv = 0 <= i) && goog.array.removeAt(arr, i);
  return rv
};
goog.array.removeAt = function $goog$array$removeAt$(arr, i) {
  goog.asserts.assert(null != arr.length);
  return 1 == goog.array.ARRAY_PROTOTYPE_.splice.call(arr, i, 1).length
};
goog.array.removeIf = function $goog$array$removeIf$(arr, f, opt_obj) {
  var i = goog.array.findIndex(arr, f, opt_obj);
  return 0 <= i ? (goog.array.removeAt(arr, i), !0) : !1
};
goog.array.concat = function $goog$array$concat$(var_args) {
  return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_, arguments)
};
goog.array.clone = function $goog$array$clone$(arr) {
  if(goog.isArray(arr)) {
    return goog.array.concat(arr)
  }
  for(var rv = [], i = 0, len = arr.length;i < len;i++) {
    rv[i] = arr[i]
  }
  return rv
};
goog.array.toArray = function $goog$array$toArray$(object) {
  return goog.isArray(object) ? goog.array.concat(object) : goog.array.clone(object)
};
goog.array.extend = function $goog$array$extend$(arr1, var_args) {
  for(var i = 1;i < arguments.length;i++) {
    var arr2 = arguments[i], isArrayLike;
    if(goog.isArray(arr2) || (isArrayLike = goog.isArrayLike(arr2)) && arr2.hasOwnProperty("callee")) {
      arr1.push.apply(arr1, arr2)
    }else {
      if(isArrayLike) {
        for(var len1 = arr1.length, len2 = arr2.length, j = 0;j < len2;j++) {
          arr1[len1 + j] = arr2[j]
        }
      }else {
        arr1.push(arr2)
      }
    }
  }
};
goog.array.splice = function $goog$array$splice$(arr, index, howMany, var_args) {
  goog.asserts.assert(null != arr.length);
  return goog.array.ARRAY_PROTOTYPE_.splice.apply(arr, goog.array.slice(arguments, 1))
};
goog.array.slice = function $goog$array$slice$(arr, start, opt_end) {
  goog.asserts.assert(null != arr.length);
  return 2 >= arguments.length ? goog.array.ARRAY_PROTOTYPE_.slice.call(arr, start) : goog.array.ARRAY_PROTOTYPE_.slice.call(arr, start, opt_end)
};
goog.array.removeDuplicates = function $goog$array$removeDuplicates$(arr, opt_rv) {
  for(var returnArray = opt_rv || arr, seen = {}, cursorInsert = 0, cursorRead = 0;cursorRead < arr.length;) {
    var current = arr[cursorRead++], key = goog.isObject(current) ? "o" + goog.getUid(current) : (typeof current).charAt(0) + current;
    Object.prototype.hasOwnProperty.call(seen, key) || (seen[key] = !0, returnArray[cursorInsert++] = current)
  }
  returnArray.length = cursorInsert
};
goog.array.binarySearch = function $goog$array$binarySearch$(arr, target, opt_compareFn) {
  return goog.array.binarySearch_(arr, opt_compareFn || goog.array.defaultCompare, !1, target)
};
goog.array.binarySelect = function $goog$array$binarySelect$(arr, evaluator, opt_obj) {
  return goog.array.binarySearch_(arr, evaluator, !0, void 0, opt_obj)
};
goog.array.binarySearch_ = function $goog$array$binarySearch_$(arr, compareFn, isEvaluator, opt_target, opt_selfObj) {
  for(var left = 0, right = arr.length, found;left < right;) {
    var middle = left + right >> 1, compareResult;
    compareResult = isEvaluator ? compareFn.call(opt_selfObj, arr[middle], middle, arr) : compareFn(opt_target, arr[middle]);
    0 < compareResult ? left = middle + 1 : (right = middle, found = !compareResult)
  }
  return found ? left : ~left
};
goog.array.sort = function $goog$array$sort$(arr, opt_compareFn) {
  goog.asserts.assert(null != arr.length);
  goog.array.ARRAY_PROTOTYPE_.sort.call(arr, opt_compareFn || goog.array.defaultCompare)
};
goog.array.stableSort = function $goog$array$stableSort$(arr, opt_compareFn) {
  function stableCompareFn(obj1, obj2) {
    return valueCompareFn(obj1.value, obj2.value) || obj1.index - obj2.index
  }
  for(var i = 0;i < arr.length;i++) {
    arr[i] = {index:i, value:arr[i]}
  }
  var valueCompareFn = opt_compareFn || goog.array.defaultCompare;
  goog.array.sort(arr, stableCompareFn);
  for(i = 0;i < arr.length;i++) {
    arr[i] = arr[i].value
  }
};
goog.array.sortObjectsByKey = function $goog$array$sortObjectsByKey$(arr, key, opt_compareFn) {
  var compare = opt_compareFn || goog.array.defaultCompare;
  goog.array.sort(arr, function(a, b) {
    return compare(a[key], b[key])
  })
};
goog.array.isSorted = function $goog$array$isSorted$(arr, opt_compareFn, opt_strict) {
  for(var compare = opt_compareFn || goog.array.defaultCompare, i = 1;i < arr.length;i++) {
    var compareResult = compare(arr[i - 1], arr[i]);
    if(0 < compareResult || 0 == compareResult && opt_strict) {
      return!1
    }
  }
  return!0
};
goog.array.equals = function $goog$array$equals$(arr1, arr2, opt_equalsFn) {
  if(!goog.isArrayLike(arr1) || !goog.isArrayLike(arr2) || arr1.length != arr2.length) {
    return!1
  }
  for(var l = arr1.length, equalsFn = opt_equalsFn || goog.array.defaultCompareEquality, i = 0;i < l;i++) {
    if(!equalsFn(arr1[i], arr2[i])) {
      return!1
    }
  }
  return!0
};
goog.array.compare = function $goog$array$compare$(arr1, arr2, opt_equalsFn) {
  return goog.array.equals(arr1, arr2, opt_equalsFn)
};
goog.array.compare3 = function $goog$array$compare3$(arr1, arr2, opt_compareFn) {
  for(var compare = opt_compareFn || goog.array.defaultCompare, l = Math.min(arr1.length, arr2.length), i = 0;i < l;i++) {
    var result = compare(arr1[i], arr2[i]);
    if(0 != result) {
      return result
    }
  }
  return goog.array.defaultCompare(arr1.length, arr2.length)
};
goog.array.defaultCompare = function $goog$array$defaultCompare$(a, b) {
  return a > b ? 1 : a < b ? -1 : 0
};
goog.array.defaultCompareEquality = function $goog$array$defaultCompareEquality$(a, b) {
  return a === b
};
goog.array.binaryInsert = function $goog$array$binaryInsert$(array, value, opt_compareFn) {
  var index = goog.array.binarySearch(array, value, opt_compareFn);
  return 0 > index ? (goog.array.insertAt(array, value, -(index + 1)), !0) : !1
};
goog.array.binaryRemove = function $goog$array$binaryRemove$(array, value, opt_compareFn) {
  var index = goog.array.binarySearch(array, value, opt_compareFn);
  return 0 <= index ? goog.array.removeAt(array, index) : !1
};
goog.array.bucket = function $goog$array$bucket$(array, sorter) {
  for(var buckets = {}, i = 0;i < array.length;i++) {
    var value = array[i], key = sorter(value, i, array);
    if(goog.isDef(key)) {
      var bucket = buckets[key] || (buckets[key] = []);
      bucket.push(value)
    }
  }
  return buckets
};
goog.array.repeat = function $goog$array$repeat$(value, n) {
  for(var array = [], i = 0;i < n;i++) {
    array[i] = value
  }
  return array
};
goog.array.flatten = function $goog$array$flatten$(var_args) {
  for(var result = [], i = 0;i < arguments.length;i++) {
    var element = arguments[i];
    goog.isArray(element) ? result.push.apply(result, goog.array.flatten.apply(null, element)) : result.push(element)
  }
  return result
};
goog.array.rotate = function $goog$array$rotate$(array, n) {
  goog.asserts.assert(null != array.length);
  array.length && (n %= array.length, 0 < n ? goog.array.ARRAY_PROTOTYPE_.unshift.apply(array, array.splice(-n, n)) : 0 > n && goog.array.ARRAY_PROTOTYPE_.push.apply(array, array.splice(0, -n)));
  return array
};
goog.array.zip = function $goog$array$zip$(var_args) {
  if(!arguments.length) {
    return[]
  }
  for(var result = [], i = 0;;i++) {
    for(var value = [], j = 0;j < arguments.length;j++) {
      var arr = arguments[j];
      if(i >= arr.length) {
        return result
      }
      value.push(arr[i])
    }
    result.push(value)
  }
};
goog.array.shuffle = function $goog$array$shuffle$(arr, opt_randFn) {
  for(var randFn = opt_randFn || Math.random, i = arr.length - 1;0 < i;i--) {
    var j = Math.floor(randFn() * (i + 1)), tmp = arr[i];
    arr[i] = arr[j];
    arr[j] = tmp
  }
};
goog.object = {};
goog.object.forEach = function $goog$object$forEach$(obj, f, opt_obj) {
  for(var key in obj) {
    f.call(opt_obj, obj[key], key, obj)
  }
};
goog.object.filter = function $goog$object$filter$(obj, f, opt_obj) {
  var res = {}, key;
  for(key in obj) {
    f.call(opt_obj, obj[key], key, obj) && (res[key] = obj[key])
  }
  return res
};
goog.object.map = function $goog$object$map$(obj, f, opt_obj) {
  var res = {}, key;
  for(key in obj) {
    res[key] = f.call(opt_obj, obj[key], key, obj)
  }
  return res
};
goog.object.some = function $goog$object$some$(obj, f, opt_obj) {
  for(var key in obj) {
    if(f.call(opt_obj, obj[key], key, obj)) {
      return!0
    }
  }
  return!1
};
goog.object.every = function $goog$object$every$(obj, f, opt_obj) {
  for(var key in obj) {
    if(!f.call(opt_obj, obj[key], key, obj)) {
      return!1
    }
  }
  return!0
};
goog.object.getCount = function $goog$object$getCount$(obj) {
  var rv = 0, key;
  for(key in obj) {
    rv++
  }
  return rv
};
goog.object.getAnyKey = function $goog$object$getAnyKey$(obj) {
  for(var key in obj) {
    return key
  }
};
goog.object.getAnyValue = function $goog$object$getAnyValue$(obj) {
  for(var key in obj) {
    return obj[key]
  }
};
goog.object.contains = function $goog$object$contains$(obj, val) {
  return goog.object.containsValue(obj, val)
};
goog.object.getValues = function $goog$object$getValues$(obj) {
  var res = [], i = 0, key;
  for(key in obj) {
    res[i++] = obj[key]
  }
  return res
};
goog.object.getKeys = function $goog$object$getKeys$(obj) {
  var res = [], i = 0, key;
  for(key in obj) {
    res[i++] = key
  }
  return res
};
goog.object.getValueByKeys = function $goog$object$getValueByKeys$(obj, var_args) {
  for(var isArrayLike = goog.isArrayLike(var_args), keys = isArrayLike ? var_args : arguments, i = isArrayLike ? 0 : 1;i < keys.length && !(obj = obj[keys[i]], !goog.isDef(obj));i++) {
  }
  return obj
};
goog.object.containsKey = function $goog$object$containsKey$(obj, key) {
  return key in obj
};
goog.object.containsValue = function $goog$object$containsValue$(obj, val) {
  for(var key in obj) {
    if(obj[key] == val) {
      return!0
    }
  }
  return!1
};
goog.object.findKey = function $goog$object$findKey$(obj, f, opt_this) {
  for(var key in obj) {
    if(f.call(opt_this, obj[key], key, obj)) {
      return key
    }
  }
};
goog.object.findValue = function $goog$object$findValue$(obj, f, opt_this) {
  var key = goog.object.findKey(obj, f, opt_this);
  return key && obj[key]
};
goog.object.isEmpty = function $goog$object$isEmpty$(obj) {
  for(var key in obj) {
    return!1
  }
  return!0
};
goog.object.clear = function $goog$object$clear$(obj) {
  for(var i in obj) {
    delete obj[i]
  }
};
goog.object.remove = function $goog$object$remove$(obj, key) {
  var rv;
  (rv = key in obj) && delete obj[key];
  return rv
};
goog.object.add = function $goog$object$add$(obj, key, val) {
  if(key in obj) {
    throw Error('The object already contains the key "' + key + '"');
  }
  goog.object.set(obj, key, val)
};
goog.object.get = function $goog$object$get$(obj, key, opt_val) {
  return key in obj ? obj[key] : opt_val
};
goog.object.set = function $goog$object$set$(obj, key, value) {
  obj[key] = value
};
goog.object.setIfUndefined = function $goog$object$setIfUndefined$(obj, key, value) {
  return key in obj ? obj[key] : obj[key] = value
};
goog.object.clone = function $goog$object$clone$(obj) {
  var res = {}, key;
  for(key in obj) {
    res[key] = obj[key]
  }
  return res
};
goog.object.unsafeClone = function $goog$object$unsafeClone$(obj) {
  var type = goog.typeOf(obj);
  if("object" == type || "array" == type) {
    if(obj.clone) {
      return obj.clone()
    }
    var clone = "array" == type ? [] : {}, key;
    for(key in obj) {
      clone[key] = goog.object.unsafeClone(obj[key])
    }
    return clone
  }
  return obj
};
goog.object.transpose = function $goog$object$transpose$(obj) {
  var transposed = {}, key;
  for(key in obj) {
    transposed[obj[key]] = key
  }
  return transposed
};
goog.object.PROTOTYPE_FIELDS_ = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");
goog.object.extend = function $goog$object$extend$(target, var_args) {
  for(var key, source, i = 1;i < arguments.length;i++) {
    source = arguments[i];
    for(key in source) {
      target[key] = source[key]
    }
    for(var j = 0;j < goog.object.PROTOTYPE_FIELDS_.length;j++) {
      key = goog.object.PROTOTYPE_FIELDS_[j], Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key])
    }
  }
};
goog.object.create = function $goog$object$create$(var_args) {
  var argLength = arguments.length;
  if(1 == argLength && goog.isArray(arguments[0])) {
    return goog.object.create.apply(null, arguments[0])
  }
  if(argLength % 2) {
    throw Error("Uneven number of arguments");
  }
  for(var rv = {}, i = 0;i < argLength;i += 2) {
    rv[arguments[i]] = arguments[i + 1]
  }
  return rv
};
goog.object.createSet = function $goog$object$createSet$(var_args) {
  var argLength = arguments.length;
  if(1 == argLength && goog.isArray(arguments[0])) {
    return goog.object.createSet.apply(null, arguments[0])
  }
  for(var rv = {}, i = 0;i < argLength;i++) {
    rv[arguments[i]] = !0
  }
  return rv
};
goog.ime = {};
goog.ime.lang = {};
goog.ime.lang.Script = function $goog$ime$lang$Script$(scriptCode, ranges, delimiters, opt_style, opt_isRtl) {
  this.ranges_ = ranges;
  this.delimiters_ = {};
  this.setDelimiters(delimiters);
  this.style_ = opt_style || {};
  this.isRtl_ = !!opt_isRtl
};
goog.ime.lang.Script.instances_ = {};
goog.ime.lang.Script.define = function $goog$ime$lang$Script$define$(scriptCode, script) {
  goog.ime.lang.Script.instances_[scriptCode] = script
};
goog.ime.lang.Script.get = function $goog$ime$lang$Script$get$(scriptCode) {
  return goog.ime.lang.Script.instances_[scriptCode]
};
goog.ime.lang.Script.LTR_MARK = "\u200e";
goog.ime.lang.Script.WHITESPACE_CHARS = " \t\r\n" + String.fromCharCode(160);
goog.ime.lang.Script.CONJUNCTION_CHARS = "`'-_";
goog.ime.lang.Script.PUNCTUATION_CHARS = "`'-_~!@#$%^&*()+=[]\\{}|;:\",./<>?\u2026\u2018\u2019\u201c\u201d";
goog.ime.lang.Script.DELIMITER_CHARS = goog.ime.lang.Script.PUNCTUATION_CHARS + goog.ime.lang.Script.LTR_MARK + goog.ime.lang.Script.WHITESPACE_CHARS;
goog.ime.lang.Script.isWhitespace = function $goog$ime$lang$Script$isWhitespace$(ch) {
  return-1 != goog.ime.lang.Script.WHITESPACE_CHARS.indexOf(ch)
};
goog.ime.lang.Script.prototype.setDelimiters = function $goog$ime$lang$Script$$setDelimiters$(delimiters) {
  for(var i = 0, l = delimiters.length;i < l;i++) {
    this.delimiters_[delimiters.charAt(i)] = !0
  }
};
goog.ime.lang.Script.prototype.isAlphaDigit = function $goog$ime$lang$Script$$isAlphaDigit$(ch) {
  return this.isChar(ch) && !this.isDelimiter(ch)
};
goog.ime.lang.Script.prototype.isDelimiter = function $goog$ime$lang$Script$$isDelimiter$(ch) {
  return!!this.delimiters_[ch]
};
goog.ime.lang.Script.prototype.isChar = function $goog$ime$lang$Script$$isChar$(ch) {
  if(this.isDelimiter(ch)) {
    return!0
  }
  for(var i = 0, l = this.ranges_.length;i < l;i++) {
    var range = this.ranges_[i];
    if(ch >= range.start && ch <= range.end) {
      return!0
    }
  }
  return!1
};
goog.ime.lang.Script.prototype.isRightToLeft = function $goog$ime$lang$Script$$isRightToLeft$() {
  return this.isRtl_
};
goog.ime.lang.Script.prototype.getRecommendedStyle = function $goog$ime$lang$Script$$getRecommendedStyle$() {
  return this.style_
};
goog.ime.lang.Language = function $goog$ime$lang$Language$(langName, langCode, displayName, script) {
  this.script_ = script
};
goog.ime.lang.Language.instances_ = {};
goog.ime.lang.Language.define = function $goog$ime$lang$Language$define$(languageCode, language) {
  goog.ime.lang.Language.instances_[languageCode] = language
};
goog.ime.lang.Language.get = function $goog$ime$lang$Language$get$(languageCode) {
  return goog.ime.lang.Language.instances_[languageCode]
};
goog.ime.lang.Language.prototype.isDelimiter = function $goog$ime$lang$Language$$isDelimiter$(ch) {
  return this.script_.isDelimiter(ch)
};
goog.ime.lang.Language.prototype.isAlphaDigit = function $goog$ime$lang$Language$$isAlphaDigit$(ch) {
  return this.script_.isAlphaDigit(ch)
};
goog.ime.lang.Language.prototype.isChar = function $goog$ime$lang$Language$$isChar$(ch) {
  return this.script_.isChar(ch)
};
goog.ime.lang.Language.prototype.isWord = function $goog$ime$lang$Language$$isWord$(text) {
  if(!text) {
    return!1
  }
  for(var i = 0, len = text.length;i < len;i++) {
    var ch = text.charAt(i);
    if(!this.isChar(ch)) {
      return!1
    }
  }
  return!0
};
goog.ime.lang.Language.prototype.isRightToLeft = function $goog$ime$lang$Language$$isRightToLeft$() {
  return this.script_.isRightToLeft()
};
goog.ime.lang.Language.prototype.getRecommendedStyle = function $goog$ime$lang$Language$$getRecommendedStyle$() {
  return this.script_.getRecommendedStyle()
};
goog.ime.lang.LanguageCode = {AMHARIC:"am", ARABIC:"ar", BENGALI:"bn", SIMPLIFIED_CHINESE:"zh-hans", ENGLISH:"en", GREEK:"el", GUJARATI:"gu", HEBREW:"he", HEBREW_IW:"iw", HINDI:"hi", HIRAGANA:"ja-Hira", JAPANESE:"ja", KANNADA:"kn", MALAYALAM:"ml", MARATHI:"mr", NEPALI:"ne", ORIYA:"or", PERSIAN:"fa", PUNJABI:"pa", RUSSIAN:"ru", SANSKRIT:"sa", SERBIAN:"sr", SERBIAN_LATIN:"sr-latn", SINHALESE:"si", TAMIL:"ta", TELUGU:"te", TIGRINYA:"ti", TRADITIONAL_CHINESE:"zh-hant", URDU:"ur", VIETNAMESE:"vi"};
goog.ime.lang.LanguageCodePair = function $goog$ime$lang$LanguageCodePair$(sourceLangCode, targetLangCode) {
  this.sourceLangCode = sourceLangCode;
  this.targetLangCode = targetLangCode;
  this.string_ = goog.ime.lang.LanguageCodePair.toString(sourceLangCode, targetLangCode)
};
goog.ime.lang.LanguageCodePair.instances_ = {};
goog.ime.lang.LanguageCodePair.toString = function $goog$ime$lang$LanguageCodePair$toString$(sourceLangCode, targetLangCode) {
  return[sourceLangCode, targetLangCode].join("|")
};
goog.ime.lang.LanguageCodePair.get = function $goog$ime$lang$LanguageCodePair$get$(sourceLangCode, targetLangCode) {
  sourceLangCode == goog.ime.lang.LanguageCode.HEBREW_IW ? sourceLangCode = goog.ime.lang.LanguageCode.HEBREW : targetLangCode == goog.ime.lang.LanguageCode.HEBREW_IW && (targetLangCode = goog.ime.lang.LanguageCode.HEBREW);
  var langCodePairStr = goog.ime.lang.LanguageCodePair.toString(sourceLangCode, targetLangCode);
  return goog.ime.lang.LanguageCodePair.instances_[langCodePairStr] || (goog.ime.lang.LanguageCodePair.instances_[langCodePairStr] = new goog.ime.lang.LanguageCodePair(sourceLangCode, targetLangCode))
};
goog.ime.lang.LanguageCodePair.prototype.toString = function $goog$ime$lang$LanguageCodePair$$toString$() {
  return this.string_
};
goog.ime.lang.LanguageCodePair.prototype.inverse = function $goog$ime$lang$LanguageCodePair$$inverse$() {
  return goog.ime.lang.LanguageCodePair.get(this.targetLangCode, this.sourceLangCode)
};
goog.ime.lang.InputToolType = {IME:"im", KBD:"vkd"};
goog.ime.lang.InputToolCode = {INPUTMETHOD_TRANSLITERATION_AMHARIC:"im_t13n_am", INPUTMETHOD_TRANSLITERATION_ARABIC:"im_t13n_ar", INPUTMETHOD_TRANSLITERATION_BENGALI:"im_t13n_bn", INPUTMETHOD_PINYIN_CHINESE_SIMPLIFIED:"im_pinyin_zh_hans", INPUTMETHOD_PINYIN_CHINESE_TRADITIONAL:"im_pinyin_zh_hant", INPUTMETHOD_WUBI_CHINESE_SIMPLIFIED:"im_wubi_zh_hans", INPUTMETHOD_ZHUYIN_CHINESE_TRADITIONAL:"im_zhuyin_zh_hant", INPUTMETHOD_TRANSLITERATION_GREEK:"im_t13n_el", INPUTMETHOD_TRANSLITERATION_GUJARATI:"im_t13n_gu", 
INPUTMETHOD_TRANSLITERATION_HEBREW:"im_t13n_he", INPUTMETHOD_TRANSLITERATION_HEBREW_IW:"im_t13n_iw", INPUTMETHOD_TRANSLITERATION_HINDI:"im_t13n_hi", INPUTMETHOD_TRANSLITERATION_JAPANESE:"im_t13n_ja", INPUTMETHOD_TRANSLITERATION_HIRAGANA:"im_t13n_ja-Hira", INPUTMETHOD_TRANSLITERATION_KANNADA:"im_t13n_kn", INPUTMETHOD_TRANSLITERATION_MALAYALAM:"im_t13n_ml", INPUTMETHOD_TRANSLITERATION_MARATHI:"im_t13n_mr", INPUTMETHOD_TRANSLITERATION_NEPALI:"im_t13n_ne", INPUTMETHOD_TRANSLITERATION_ORIYA:"im_t13n_or", 
INPUTMETHOD_TRANSLITERATION_PERSIAN:"im_t13n_fa", INPUTMETHOD_TRANSLITERATION_PUNJABI:"im_t13n_pa", INPUTMETHOD_TRANSLITERATION_RUSSIAN:"im_t13n_ru", INPUTMETHOD_TRANSLITERATION_SANSKRIT:"im_t13n_sa", INPUTMETHOD_TRANSLITERATION_SERBIAN:"im_t13n_sr", INPUTMETHOD_TRANSLITERATION_SINHALESE:"im_t13n_si", INPUTMETHOD_TRANSLITERATION_TAMIL:"im_t13n_ta", INPUTMETHOD_TRANSLITERATION_TELUGU:"im_t13n_te", INPUTMETHOD_TRANSLITERATION_TIGRINYA:"im_t13n_ti", INPUTMETHOD_TRANSLITERATION_URDU:"im_t13n_ur", INPUTMETHOD_TRANSLITERATION_VIETNAMESE:"im_t13n_vi", 
INPUTMETHOD_TRANSLITERATION_ENGLISH:"im_t13n_en", KEYBOARD_ALBANIAN:"vkd_sq", KEYBOARD_ARABIC:"vkd_ar", KEYBOARD_ARMENIAN_EASTERN:"vkd_hy_east", KEYBOARD_ARMENIAN_WESTERN:"vkd_hy_west", KEYBOARD_BASQUE:"vkd_eu", KEYBOARD_BELARUSIAN:"vkd_be", KEYBOARD_BENGALI_INSCRIPT:"vkd_bn_inscript", KEYBOARD_BENGALI_PHONETIC:"vkd_bn_phone", KEYBOARD_BOSNIAN:"vkd_bs", KEYBOARD_BRAZILIAN_PORTUGUESE:"vkd_pt_br", KEYBOARD_BULGARIAN:"vkd_bg", KEYBOARD_BULGARIAN_PHONETIC:"vkd_bg_phone", KEYBOARD_CATALAN:"vkd_ca", KEYBOARD_CHEROKEE:"vkd_chr", 
KEYBOARD_CROATIAN:"vkd_hr", KEYBOARD_CZECH:"vkd_cs", KEYBOARD_CZECH_QWERTZ:"vkd_cs_qwertz", KEYBOARD_DANISH:"vkd_da", KEYBOARD_DARI:"vkd_prs", KEYBOARD_DUTCH:"vkd_nl", KEYBOARD_DEVANAGARI_PHONETIC:"vkd_deva_phone", KEYBOARD_ENGLISH:"vkd_en", KEYBOARD_ESTONIAN:"vkd_et", KEYBOARD_ETHIOPIC:"vkd_ethi", KEYBOARD_FINNISH:"vkd_fi", KEYBOARD_FRENCH:"vkd_fr", KEYBOARD_GALICIAN:"vkd_gl", KEYBOARD_GEORGIAN_QWERTY:"vkd_ka_qwerty", KEYBOARD_GEORGIAN_TYPEWRITER:"vkd_ka_typewriter", KEYBOARD_GERMAN:"vkd_de", KEYBOARD_GREEK:"vkd_el", 
KEYBOARD_GUJARATI_INSCRIPT:"vkd_gu_inscript", KEYBOARD_GUJARATI_PHONETIC:"vkd_gu_phone", KEYBOARD_GURMUKHI_INSCRIPT:"vkd_guru_inscript", KEYBOARD_GURMUKHI_PHONETIC:"vkd_guru_phone", KEYBOARD_HEBREW:"vkd_he", KEYBOARD_HEBREW_IW:"vkd_iw", KEYBOARD_HINDI:"vkd_hi", KEYBOARD_HUNGARIAN_101:"vkd_hu_101", KEYBOARD_ICELANDIC:"vkd_is", KEYBOARD_ITALIAN:"vkd_it", KEYBOARD_KANNADA_INSCRIPT:"vkd_kn_inscript", KEYBOARD_KANNADA_PHONETIC:"vkd_kn_phone", KEYBOARD_KAZAKH:"vkd_kk", KEYBOARD_KHMER:"vkd_km", KEYBOARD_KOREAN:"vkd_ko", 
KEYBOARD_KYRGYZ:"vkd_ky_cyrl", KEYBOARD_LAO:"vkd_lo", KEYBOARD_LATVIAN:"vkd_lv", KEYBOARD_LITHUANIAN:"vkd_lt", KEYBOARD_MACEDONIAN:"vkd_mk", KEYBOARD_MALAYALAM_INSCRIPT:"vkd_ml_inscript", KEYBOARD_MALAYALAM_PHONETIC:"vkd_ml_phone", KEYBOARD_MALTESE:"vkd_mt", KEYBOARD_MAORI:"vkd_mi", KEYBOARD_MONGOLIAN_CYRILLIC:"vkd_mn_cyrl", KEYBOARD_MONTENEGRIN:"vkd_srp", KEYBOARD_NORWEGIAN:"vkd_no", KEYBOARD_ORIYA_INSCRIPT:"vkd_or_inscript", KEYBOARD_ORIYA_PHONETIC:"vkd_or_phone", KEYBOARD_PAN_AFRICA_LATIN:"vkd_latn_002", 
KEYBOARD_PASHTO:"vkd_ps", KEYBOARD_PERSIAN:"vkd_fa", KEYBOARD_POLISH:"vkd_pl", KEYBOARD_PORTUGUESE:"vkd_pt_pt", KEYBOARD_ROMANI:"vkd_rom", KEYBOARD_ROMANIAN:"vkd_ro", KEYBOARD_ROMANIAN_SR13392_PRIMARY:"vkd_ro_sr13392_primary", KEYBOARD_ROMANIAN_SR13392_SECONDARY:"vkd_ro_sr13392_secondary", KEYBOARD_RUSSIAN:"vkd_ru", KEYBOARD_SANSKRIT_PHONETIC:"vkd_sa_phone", KEYBOARD_SERBIAN_CYRILLIC:"vkd_sr_cyrl", KEYBOARD_SERBIAN_LATIN:"vkd_sr_latn", KEYBOARD_SINHALA:"vkd_si", KEYBOARD_SLOVAK:"vkd_sk", KEYBOARD_SLOVAK_QWERTY:"vkd_sk_qwerty", 
KEYBOARD_SLOVENIAN:"vkd_sl", KEYBOARD_SOUTHERN_UZBEK:"vkd_uzs", KEYBOARD_SPANISH:"vkd_es_es", KEYBOARD_SWEDISH:"vkd_sv", KEYBOARD_SWISS_GERMAN:"vkd_de_ch", KEYBOARD_TAMIL_99:"vkd_ta_tamil99", KEYBOARD_TAMIL_INSCRIPT:"vkd_ta_inscript", KEYBOARD_TAMIL_PHONETIC:"vkd_ta_phone", KEYBOARD_TATAR:"vkd_tt", KEYBOARD_TELUGU_INSCRIPT:"vkd_te_inscript", KEYBOARD_TELUGU_PHONETIC:"vkd_te_phone", KEYBOARD_THAI:"vkd_th", KEYBOARD_TURKISH_F:"vkd_tr_f", KEYBOARD_TURKISH_Q:"vkd_tr_q", KEYBOARD_UIGHUR:"vkd_ug", KEYBOARD_UKRAINIAN_101:"vkd_uk_101", 
KEYBOARD_URDU:"vkd_ur", KEYBOARD_UZBEK_LATIN:"vkd_uz_latn", KEYBOARD_UZBEK_CYRILLIC_PHONETIC:"vkd_uz_cyrl_phone", KEYBOARD_UZBEK_CYRILLIC_TYPEWRITTER:"vkd_uz_cyrl_type", KEYBOARD_VIETNAMESE_TCVN:"vkd_vi_tcvn", KEYBOARD_VIETNAMESE_TELEX:"vkd_vi_telex", KEYBOARD_VIETNAMESE_VIQR:"vkd_vi_viqr"};
goog.ime.lang.InputTool = function $goog$ime$lang$InputTool$(inputToolCode) {
  this.code = inputToolCode;
  this.type = null;
  this.languageCode = goog.ime.lang.LanguageCode.ENGLISH;
  this.layoutCode = null;
  this.parseInputToolCode_()
};
goog.ime.lang.InputTool.RtlKeyboards = [goog.ime.lang.InputToolCode.KEYBOARD_ARABIC, goog.ime.lang.InputToolCode.KEYBOARD_DARI, goog.ime.lang.InputToolCode.KEYBOARD_HEBREW, goog.ime.lang.InputToolCode.KEYBOARD_PASHTO, goog.ime.lang.InputToolCode.KEYBOARD_PERSIAN, goog.ime.lang.InputToolCode.KEYBOARD_SOUTHERN_UZBEK, goog.ime.lang.InputToolCode.KEYBOARD_UIGHUR, goog.ime.lang.InputToolCode.KEYBOARD_URDU];
goog.ime.lang.InputTool.instances_ = {};
goog.ime.lang.InputTool.get = function $goog$ime$lang$InputTool$get$(inputToolCode) {
  return goog.object.contains(goog.ime.lang.InputToolCode, inputToolCode) ? (inputToolCode == goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HEBREW_IW ? inputToolCode = goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HEBREW : inputToolCode == goog.ime.lang.InputToolCode.KEYBOARD_HEBREW_IW && (inputToolCode = goog.ime.lang.InputToolCode.KEYBOARD_HEBREW), goog.ime.lang.InputTool.instances_[inputToolCode] || (goog.ime.lang.InputTool.instances_[inputToolCode] = new goog.ime.lang.InputTool(inputToolCode)), 
  goog.ime.lang.InputTool.instances_[inputToolCode]) : null
};
goog.ime.lang.InputTool.getInputTool = function $goog$ime$lang$InputTool$getInputTool$(type, code) {
  return type == goog.ime.lang.InputToolType.IME ? "zh" == code || code == goog.ime.lang.LanguageCode.SIMPLIFIED_CHINESE ? goog.ime.lang.InputTool.get(goog.ime.lang.InputToolCode.INPUTMETHOD_PINYIN_CHINESE_SIMPLIFIED) : code == goog.ime.lang.LanguageCode.TRADITIONAL_CHINESE ? goog.ime.lang.InputTool.get(goog.ime.lang.InputToolCode.INPUTMETHOD_ZHUYIN_CHINESE_TRADITIONAL) : goog.ime.lang.InputTool.get(type + "_t13n_" + code) : goog.ime.lang.InputTool.get(type + "_" + code)
};
goog.ime.lang.InputTool.prototype.parseInputToolCode_ = function $goog$ime$lang$InputTool$$parseInputToolCode_$() {
  if(goog.string.startsWith(this.code, goog.ime.lang.InputToolType.IME)) {
    this.type = goog.ime.lang.InputToolType.IME;
    var codes = goog.ime.lang.InputToolCode;
    switch(this.code) {
      case codes.INPUTMETHOD_PINYIN_CHINESE_SIMPLIFIED:
      ;
      case codes.INPUTMETHOD_WUBI_CHINESE_SIMPLIFIED:
        this.languageCode = goog.ime.lang.LanguageCode.SIMPLIFIED_CHINESE;
        break;
      case codes.INPUTMETHOD_PINYIN_CHINESE_TRADITIONAL:
      ;
      case codes.INPUTMETHOD_ZHUYIN_CHINESE_TRADITIONAL:
        this.languageCode = goog.ime.lang.LanguageCode.TRADITIONAL_CHINESE;
        break;
      default:
        var strs = this.code.split("_");
        "t13n" == strs[1] && (this.languageCode = strs[2])
    }
  }else {
    goog.string.startsWith(this.code, goog.ime.lang.InputToolType.KBD) && (this.type = goog.ime.lang.InputToolType.KBD, this.layoutCode = this.code.substring(this.code.indexOf("_") + 1))
  }
};
goog.ime.lang.InputTool.prototype.toString = function $goog$ime$lang$InputTool$$toString$() {
  return this.code
};
goog.ime.lang.InputTool.prototype.getLanguagePair = function $goog$ime$lang$InputTool$$getLanguagePair$() {
  return this.type == goog.ime.lang.InputToolType.IME ? this.languageCode == goog.ime.lang.LanguageCode.JAPANESE ? goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.HIRAGANA, this.languageCode) : goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, this.languageCode) : null
};
goog.ime.lang.InputTool.prototype.getDirection = function $goog$ime$lang$InputTool$$getDirection$() {
  return this.isRightToLeft() ? "rtl" : "ltr"
};
goog.ime.lang.InputTool.prototype.isRightToLeft = function $goog$ime$lang$InputTool$$isRightToLeft$() {
  if(this.type == goog.ime.lang.InputToolType.IME) {
    var lang = goog.ime.lang.Language.get(this.languageCode);
    return lang ? lang.isRightToLeft() : !1
  }
  return goog.array.contains(goog.ime.lang.InputTool.RtlKeyboards, this.code)
};
goog.ime.common = {};
goog.ime.common.Inputable = function $goog$ime$common$Inputable$() {
};
goog.math = {};
goog.math.Coordinate = function $goog$math$Coordinate$(opt_x, opt_y) {
  this.x = goog.isDef(opt_x) ? opt_x : 0;
  this.y = goog.isDef(opt_y) ? opt_y : 0
};
goog.math.Coordinate.prototype.clone = function $goog$math$Coordinate$$clone$() {
  return new goog.math.Coordinate(this.x, this.y)
};
goog.DEBUG && (goog.math.Coordinate.prototype.toString = function $goog$math$Coordinate$$toString$() {
  return"(" + this.x + ", " + this.y + ")"
});
goog.math.Coordinate.equals = function $goog$math$Coordinate$equals$(a, b) {
  return a == b ? true : !a || !b ? false : a.x == b.x && a.y == b.y
};
goog.math.Coordinate.distance = function $goog$math$Coordinate$distance$(a, b) {
  var dx = a.x - b.x, dy = a.y - b.y;
  return Math.sqrt(dx * dx + dy * dy)
};
goog.math.Coordinate.squaredDistance = function $goog$math$Coordinate$squaredDistance$(a, b) {
  var dx = a.x - b.x, dy = a.y - b.y;
  return dx * dx + dy * dy
};
goog.math.Coordinate.difference = function $goog$math$Coordinate$difference$(a, b) {
  return new goog.math.Coordinate(a.x - b.x, a.y - b.y)
};
goog.math.Coordinate.sum = function $goog$math$Coordinate$sum$(a, b) {
  return new goog.math.Coordinate(a.x + b.x, a.y + b.y)
};
goog.math.Size = function $goog$math$Size$(width, height) {
  this.width = width;
  this.height = height
};
goog.math.Size.equals = function $goog$math$Size$equals$(a, b) {
  return a == b ? !0 : !a || !b ? !1 : a.width == b.width && a.height == b.height
};
goog.math.Size.prototype.clone = function $goog$math$Size$$clone$() {
  return new goog.math.Size(this.width, this.height)
};
goog.DEBUG && (goog.math.Size.prototype.toString = function $goog$math$Size$$toString$() {
  return"(" + this.width + " x " + this.height + ")"
});
goog.math.Size.prototype.area = function $goog$math$Size$$area$() {
  return this.width * this.height
};
goog.math.Size.prototype.isEmpty = function $goog$math$Size$$isEmpty$() {
  return!this.area()
};
goog.math.Size.prototype.ceil = function $goog$math$Size$$ceil$() {
  this.width = Math.ceil(this.width);
  this.height = Math.ceil(this.height);
  return this
};
goog.math.Size.prototype.floor = function $goog$math$Size$$floor$() {
  this.width = Math.floor(this.width);
  this.height = Math.floor(this.height);
  return this
};
goog.math.Size.prototype.round = function $goog$math$Size$$round$() {
  this.width = Math.round(this.width);
  this.height = Math.round(this.height);
  return this
};
goog.userAgent = {};
goog.userAgent.ASSUME_IE = !1;
goog.userAgent.ASSUME_GECKO = !1;
goog.userAgent.ASSUME_WEBKIT = !1;
goog.userAgent.ASSUME_MOBILE_WEBKIT = !1;
goog.userAgent.ASSUME_OPERA = !1;
goog.userAgent.ASSUME_ANY_VERSION = !1;
goog.userAgent.BROWSER_KNOWN_ = goog.userAgent.ASSUME_IE || goog.userAgent.ASSUME_GECKO || goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.ASSUME_WEBKIT || goog.userAgent.ASSUME_OPERA;
goog.userAgent.getUserAgentString = function $goog$userAgent$getUserAgentString$() {
  return goog.global.navigator ? goog.global.navigator.userAgent : null
};
goog.userAgent.getNavigator = function $goog$userAgent$getNavigator$() {
  return goog.global.navigator
};
goog.userAgent.init_ = function $goog$userAgent$init_$() {
  goog.userAgent.detectedOpera_ = !1;
  goog.userAgent.detectedIe_ = !1;
  goog.userAgent.detectedWebkit_ = !1;
  goog.userAgent.detectedMobile_ = !1;
  goog.userAgent.detectedGecko_ = !1;
  var ua;
  if(!goog.userAgent.BROWSER_KNOWN_ && (ua = goog.userAgent.getUserAgentString())) {
    var navigator = goog.userAgent.getNavigator();
    goog.userAgent.detectedOpera_ = 0 == ua.indexOf("Opera");
    goog.userAgent.detectedIe_ = !goog.userAgent.detectedOpera_ && -1 != ua.indexOf("MSIE");
    goog.userAgent.detectedWebkit_ = !goog.userAgent.detectedOpera_ && -1 != ua.indexOf("WebKit");
    goog.userAgent.detectedMobile_ = goog.userAgent.detectedWebkit_ && -1 != ua.indexOf("Mobile");
    goog.userAgent.detectedGecko_ = !goog.userAgent.detectedOpera_ && !goog.userAgent.detectedWebkit_ && "Gecko" == navigator.product
  }
};
goog.userAgent.BROWSER_KNOWN_ || goog.userAgent.init_();
goog.userAgent.OPERA = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_OPERA : goog.userAgent.detectedOpera_;
goog.userAgent.IE = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_IE : goog.userAgent.detectedIe_;
goog.userAgent.GECKO = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_GECKO : goog.userAgent.detectedGecko_;
goog.userAgent.WEBKIT = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_WEBKIT || goog.userAgent.ASSUME_MOBILE_WEBKIT : goog.userAgent.detectedWebkit_;
goog.userAgent.MOBILE = goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.detectedMobile_;
goog.userAgent.SAFARI = goog.userAgent.WEBKIT;
goog.userAgent.determinePlatform_ = function $goog$userAgent$determinePlatform_$() {
  var navigator = goog.userAgent.getNavigator();
  return navigator && navigator.platform || ""
};
goog.userAgent.PLATFORM = goog.userAgent.determinePlatform_();
goog.userAgent.ASSUME_MAC = !1;
goog.userAgent.ASSUME_WINDOWS = !1;
goog.userAgent.ASSUME_LINUX = !1;
goog.userAgent.ASSUME_X11 = !1;
goog.userAgent.PLATFORM_KNOWN_ = goog.userAgent.ASSUME_MAC || goog.userAgent.ASSUME_WINDOWS || goog.userAgent.ASSUME_LINUX || goog.userAgent.ASSUME_X11;
goog.userAgent.initPlatform_ = function $goog$userAgent$initPlatform_$() {
  goog.userAgent.detectedMac_ = goog.string.contains(goog.userAgent.PLATFORM, "Mac");
  goog.userAgent.detectedWindows_ = goog.string.contains(goog.userAgent.PLATFORM, "Win");
  goog.userAgent.detectedLinux_ = goog.string.contains(goog.userAgent.PLATFORM, "Linux");
  goog.userAgent.detectedX11_ = !!goog.userAgent.getNavigator() && goog.string.contains(goog.userAgent.getNavigator().appVersion || "", "X11")
};
goog.userAgent.PLATFORM_KNOWN_ || goog.userAgent.initPlatform_();
goog.userAgent.MAC = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_MAC : goog.userAgent.detectedMac_;
goog.userAgent.WINDOWS = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_WINDOWS : goog.userAgent.detectedWindows_;
goog.userAgent.LINUX = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_LINUX : goog.userAgent.detectedLinux_;
goog.userAgent.X11 = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_X11 : goog.userAgent.detectedX11_;
goog.userAgent.determineVersion_ = function $goog$userAgent$determineVersion_$() {
  var version = "", re;
  if(goog.userAgent.OPERA && goog.global.opera) {
    var operaVersion = goog.global.opera.version, version = "function" == typeof operaVersion ? operaVersion() : operaVersion
  }else {
    if(goog.userAgent.GECKO ? re = /rv\:([^\);]+)(\)|;)/ : goog.userAgent.IE ? re = /MSIE\s+([^\);]+)(\)|;)/ : goog.userAgent.WEBKIT && (re = /WebKit\/(\S+)/), re) {
      var arr = re.exec(goog.userAgent.getUserAgentString()), version = arr ? arr[1] : ""
    }
  }
  if(goog.userAgent.IE) {
    var docMode = goog.userAgent.getDocumentMode_();
    if(docMode > parseFloat(version)) {
      return"" + docMode
    }
  }
  return version
};
goog.userAgent.getDocumentMode_ = function $goog$userAgent$getDocumentMode_$() {
  var doc = goog.global.document;
  return doc ? doc.documentMode : void 0
};
goog.userAgent.VERSION = goog.userAgent.determineVersion_();
goog.userAgent.compare = function $goog$userAgent$compare$(v1, v2) {
  return goog.string.compareVersions(v1, v2)
};
goog.userAgent.isVersionCache_ = {};
goog.userAgent.isVersion = function $goog$userAgent$isVersion$(version) {
  return goog.userAgent.ASSUME_ANY_VERSION || goog.userAgent.isVersionCache_[version] || (goog.userAgent.isVersionCache_[version] = 0 <= goog.string.compareVersions(goog.userAgent.VERSION, version))
};
goog.userAgent.isDocumentModeCache_ = {};
goog.userAgent.isDocumentMode = function $goog$userAgent$isDocumentMode$(documentMode) {
  return goog.userAgent.isDocumentModeCache_[documentMode] || (goog.userAgent.isDocumentModeCache_[documentMode] = goog.userAgent.IE && !!document.documentMode && document.documentMode >= documentMode)
};
goog.dom = {};
goog.dom.BrowserFeature = {CAN_ADD_NAME_OR_TYPE_ATTRIBUTES:!goog.userAgent.IE || goog.userAgent.isDocumentMode(9), CAN_USE_CHILDREN_ATTRIBUTE:!goog.userAgent.GECKO && !goog.userAgent.IE || goog.userAgent.IE && goog.userAgent.isDocumentMode(9) || goog.userAgent.GECKO && goog.userAgent.isVersion("1.9.1"), CAN_USE_INNER_TEXT:goog.userAgent.IE && !goog.userAgent.isVersion("9"), CAN_USE_PARENT_ELEMENT_PROPERTY:goog.userAgent.IE || goog.userAgent.OPERA || goog.userAgent.WEBKIT, INNER_HTML_NEEDS_SCOPED_ELEMENT:goog.userAgent.IE};
goog.dom.classes = {};
goog.dom.classes.set = function $goog$dom$classes$set$(element, className) {
  element.className = className
};
goog.dom.classes.get = function $goog$dom$classes$get$(element) {
  var className = element.className;
  return goog.isString(className) && className.match(/\S+/g) || []
};
goog.dom.classes.add = function $goog$dom$classes$add$(element, var_args) {
  var classes = goog.dom.classes.get(element), args = goog.array.slice(arguments, 1), expectedCount = classes.length + args.length;
  goog.dom.classes.add_(classes, args);
  element.className = classes.join(" ");
  return classes.length == expectedCount
};
goog.dom.classes.remove = function $goog$dom$classes$remove$(element, var_args) {
  var classes = goog.dom.classes.get(element), args = goog.array.slice(arguments, 1), newClasses = goog.dom.classes.getDifference_(classes, args);
  element.className = newClasses.join(" ");
  return newClasses.length == classes.length - args.length
};
goog.dom.classes.add_ = function $goog$dom$classes$add_$(classes, args) {
  for(var i = 0;i < args.length;i++) {
    goog.array.contains(classes, args[i]) || classes.push(args[i])
  }
};
goog.dom.classes.getDifference_ = function $goog$dom$classes$getDifference_$(arr1, arr2) {
  return goog.array.filter(arr1, function(item) {
    return!goog.array.contains(arr2, item)
  })
};
goog.dom.classes.swap = function $goog$dom$classes$swap$(element, fromClass, toClass) {
  for(var classes = goog.dom.classes.get(element), removed = !1, i = 0;i < classes.length;i++) {
    classes[i] == fromClass && (goog.array.splice(classes, i--, 1), removed = !0)
  }
  removed && (classes.push(toClass), element.className = classes.join(" "));
  return removed
};
goog.dom.classes.addRemove = function $goog$dom$classes$addRemove$(element, classesToRemove, classesToAdd) {
  var classes = goog.dom.classes.get(element);
  goog.isString(classesToRemove) ? goog.array.remove(classes, classesToRemove) : goog.isArray(classesToRemove) && (classes = goog.dom.classes.getDifference_(classes, classesToRemove));
  goog.isString(classesToAdd) && !goog.array.contains(classes, classesToAdd) ? classes.push(classesToAdd) : goog.isArray(classesToAdd) && goog.dom.classes.add_(classes, classesToAdd);
  element.className = classes.join(" ")
};
goog.dom.classes.has = function $goog$dom$classes$has$(element, className) {
  return goog.array.contains(goog.dom.classes.get(element), className)
};
goog.dom.classes.enable = function $goog$dom$classes$enable$(element, className, enabled) {
  enabled ? goog.dom.classes.add(element, className) : goog.dom.classes.remove(element, className)
};
goog.dom.classes.toggle = function $goog$dom$classes$toggle$(element, className) {
  var add = !goog.dom.classes.has(element, className);
  goog.dom.classes.enable(element, className, add);
  return add
};
goog.dom.TagName = {A:"A", ABBR:"ABBR", ACRONYM:"ACRONYM", ADDRESS:"ADDRESS", APPLET:"APPLET", AREA:"AREA", AUDIO:"AUDIO", B:"B", BASE:"BASE", BASEFONT:"BASEFONT", BDO:"BDO", BIG:"BIG", BLOCKQUOTE:"BLOCKQUOTE", BODY:"BODY", BR:"BR", BUTTON:"BUTTON", CANVAS:"CANVAS", CAPTION:"CAPTION", CENTER:"CENTER", CITE:"CITE", CODE:"CODE", COL:"COL", COLGROUP:"COLGROUP", DD:"DD", DEL:"DEL", DFN:"DFN", DIR:"DIR", DIV:"DIV", DL:"DL", DT:"DT", EM:"EM", FIELDSET:"FIELDSET", FONT:"FONT", FORM:"FORM", FRAME:"FRAME", 
FRAMESET:"FRAMESET", H1:"H1", H2:"H2", H3:"H3", H4:"H4", H5:"H5", H6:"H6", HEAD:"HEAD", HR:"HR", HTML:"HTML", I:"I", IFRAME:"IFRAME", IMG:"IMG", INPUT:"INPUT", INS:"INS", ISINDEX:"ISINDEX", KBD:"KBD", LABEL:"LABEL", LEGEND:"LEGEND", LI:"LI", LINK:"LINK", MAP:"MAP", MENU:"MENU", META:"META", NOFRAMES:"NOFRAMES", NOSCRIPT:"NOSCRIPT", OBJECT:"OBJECT", OL:"OL", OPTGROUP:"OPTGROUP", OPTION:"OPTION", P:"P", PARAM:"PARAM", PRE:"PRE", Q:"Q", S:"S", SAMP:"SAMP", SCRIPT:"SCRIPT", SELECT:"SELECT", SMALL:"SMALL", 
SPAN:"SPAN", STRIKE:"STRIKE", STRONG:"STRONG", STYLE:"STYLE", SUB:"SUB", SUP:"SUP", TABLE:"TABLE", TBODY:"TBODY", TD:"TD", TEXTAREA:"TEXTAREA", TFOOT:"TFOOT", TH:"TH", THEAD:"THEAD", TITLE:"TITLE", TR:"TR", TT:"TT", U:"U", UL:"UL", VAR:"VAR", VIDEO:"VIDEO"};
goog.dom.ASSUME_QUIRKS_MODE = !1;
goog.dom.ASSUME_STANDARDS_MODE = !1;
goog.dom.COMPAT_MODE_KNOWN_ = goog.dom.ASSUME_QUIRKS_MODE || goog.dom.ASSUME_STANDARDS_MODE;
goog.dom.NodeType = {ELEMENT:1, ATTRIBUTE:2, TEXT:3, CDATA_SECTION:4, ENTITY_REFERENCE:5, ENTITY:6, PROCESSING_INSTRUCTION:7, COMMENT:8, DOCUMENT:9, DOCUMENT_TYPE:10, DOCUMENT_FRAGMENT:11, NOTATION:12};
goog.dom.getDomHelper = function $goog$dom$getDomHelper$(opt_element) {
  return opt_element ? new goog.dom.DomHelper(goog.dom.getOwnerDocument(opt_element)) : goog.dom.defaultDomHelper_ || (goog.dom.defaultDomHelper_ = new goog.dom.DomHelper)
};
goog.dom.getDocument = function $goog$dom$getDocument$() {
  return document
};
goog.dom.getElement = function $goog$dom$getElement$(element) {
  return goog.isString(element) ? document.getElementById(element) : element
};
goog.dom.$ = goog.dom.getElement;
goog.dom.getElementsByTagNameAndClass = function $goog$dom$getElementsByTagNameAndClass$(opt_tag, opt_class, opt_el) {
  return goog.dom.getElementsByTagNameAndClass_(document, opt_tag, opt_class, opt_el)
};
goog.dom.getElementsByClass = function $goog$dom$getElementsByClass$(className, opt_el) {
  var parent = opt_el || document;
  return goog.dom.canUseQuerySelector_(parent) ? parent.querySelectorAll("." + className) : parent.getElementsByClassName ? parent.getElementsByClassName(className) : goog.dom.getElementsByTagNameAndClass_(document, "*", className, opt_el)
};
goog.dom.getElementByClass = function $goog$dom$getElementByClass$(className, opt_el) {
  var parent = opt_el || document, retVal = null;
  return(retVal = goog.dom.canUseQuerySelector_(parent) ? parent.querySelector("." + className) : goog.dom.getElementsByClass(className, opt_el)[0]) || null
};
goog.dom.canUseQuerySelector_ = function $goog$dom$canUseQuerySelector_$(parent) {
  return parent.querySelectorAll && parent.querySelector && (!goog.userAgent.WEBKIT || goog.dom.isCss1CompatMode_(document) || goog.userAgent.isVersion("528"))
};
goog.dom.getElementsByTagNameAndClass_ = function $goog$dom$getElementsByTagNameAndClass_$(doc, opt_tag, opt_class, opt_el) {
  var parent = opt_el || doc, tagName = opt_tag && "*" != opt_tag ? opt_tag.toUpperCase() : "";
  if(goog.dom.canUseQuerySelector_(parent) && (tagName || opt_class)) {
    var query = tagName + (opt_class ? "." + opt_class : "");
    return parent.querySelectorAll(query)
  }
  if(opt_class && parent.getElementsByClassName) {
    var els = parent.getElementsByClassName(opt_class);
    if(tagName) {
      for(var arrayLike = {}, len = 0, i = 0, el;el = els[i];i++) {
        tagName == el.nodeName && (arrayLike[len++] = el)
      }
      arrayLike.length = len;
      return arrayLike
    }
    return els
  }
  els = parent.getElementsByTagName(tagName || "*");
  if(opt_class) {
    arrayLike = {};
    for(i = len = 0;el = els[i];i++) {
      var className = el.className;
      "function" == typeof className.split && goog.array.contains(className.split(/\s+/), opt_class) && (arrayLike[len++] = el)
    }
    arrayLike.length = len;
    return arrayLike
  }
  return els
};
goog.dom.$$ = goog.dom.getElementsByTagNameAndClass;
goog.dom.setProperties = function $goog$dom$setProperties$(element, properties) {
  goog.object.forEach(properties, function(val, key) {
    "style" == key ? element.style.cssText = val : "class" == key ? element.className = val : "for" == key ? element.htmlFor = val : key in goog.dom.DIRECT_ATTRIBUTE_MAP_ ? element.setAttribute(goog.dom.DIRECT_ATTRIBUTE_MAP_[key], val) : goog.string.startsWith(key, "aria-") ? element.setAttribute(key, val) : element[key] = val
  })
};
goog.dom.DIRECT_ATTRIBUTE_MAP_ = {cellpadding:"cellPadding", cellspacing:"cellSpacing", colspan:"colSpan", rowspan:"rowSpan", valign:"vAlign", height:"height", width:"width", usemap:"useMap", frameborder:"frameBorder", maxlength:"maxLength", type:"type"};
goog.dom.getViewportSize = function $goog$dom$getViewportSize$(opt_window) {
  return goog.dom.getViewportSize_(opt_window || window)
};
goog.dom.getViewportSize_ = function $goog$dom$getViewportSize_$(win) {
  var doc = win.document;
  if(goog.userAgent.WEBKIT && !goog.userAgent.isVersion("500") && !goog.userAgent.MOBILE) {
    "undefined" == typeof win.innerHeight && (win = window);
    var innerHeight = win.innerHeight, scrollHeight = win.document.documentElement.scrollHeight;
    win == win.top && scrollHeight < innerHeight && (innerHeight -= 15);
    return new goog.math.Size(win.innerWidth, innerHeight)
  }
  var el = goog.dom.isCss1CompatMode_(doc) ? doc.documentElement : doc.body;
  return new goog.math.Size(el.clientWidth, el.clientHeight)
};
goog.dom.getDocumentHeight = function $goog$dom$getDocumentHeight$() {
  return goog.dom.getDocumentHeight_(window)
};
goog.dom.getDocumentHeight_ = function $goog$dom$getDocumentHeight_$(win) {
  var doc = win.document, height = 0;
  if(doc) {
    var vh = goog.dom.getViewportSize_(win).height, body = doc.body, docEl = doc.documentElement;
    if(goog.dom.isCss1CompatMode_(doc) && docEl.scrollHeight) {
      height = docEl.scrollHeight != vh ? docEl.scrollHeight : docEl.offsetHeight
    }else {
      var sh = docEl.scrollHeight, oh = docEl.offsetHeight;
      docEl.clientHeight != oh && (sh = body.scrollHeight, oh = body.offsetHeight);
      height = sh > vh ? sh > oh ? sh : oh : sh < oh ? sh : oh
    }
  }
  return height
};
goog.dom.getPageScroll = function $goog$dom$getPageScroll$(opt_window) {
  var win = opt_window || goog.global || window;
  return goog.dom.getDomHelper(win.document).getDocumentScroll()
};
goog.dom.getDocumentScroll = function $goog$dom$getDocumentScroll$() {
  return goog.dom.getDocumentScroll_(document)
};
goog.dom.getDocumentScroll_ = function $goog$dom$getDocumentScroll_$(doc) {
  var el = goog.dom.getDocumentScrollElement_(doc), win = goog.dom.getWindow_(doc);
  return new goog.math.Coordinate(win.pageXOffset || el.scrollLeft, win.pageYOffset || el.scrollTop)
};
goog.dom.getDocumentScrollElement = function $goog$dom$getDocumentScrollElement$() {
  return goog.dom.getDocumentScrollElement_(document)
};
goog.dom.getDocumentScrollElement_ = function $goog$dom$getDocumentScrollElement_$(doc) {
  return!goog.userAgent.WEBKIT && goog.dom.isCss1CompatMode_(doc) ? doc.documentElement : doc.body
};
goog.dom.getWindow = function $goog$dom$getWindow$(opt_doc) {
  return opt_doc ? goog.dom.getWindow_(opt_doc) : window
};
goog.dom.getWindow_ = function $goog$dom$getWindow_$(doc) {
  return doc.parentWindow || doc.defaultView
};
goog.dom.createDom = function $goog$dom$createDom$(tagName, opt_attributes, var_args) {
  return goog.dom.createDom_(document, arguments)
};
goog.dom.createDom_ = function $goog$dom$createDom_$(doc, args) {
  var tagName = args[0], attributes = args[1];
  if(!goog.dom.BrowserFeature.CAN_ADD_NAME_OR_TYPE_ATTRIBUTES && attributes && (attributes.name || attributes.type)) {
    var tagNameArr = ["<", tagName];
    attributes.name && tagNameArr.push(' name="', goog.string.htmlEscape(attributes.name), '"');
    if(attributes.type) {
      tagNameArr.push(' type="', goog.string.htmlEscape(attributes.type), '"');
      var clone = {};
      goog.object.extend(clone, attributes);
      attributes = clone;
      delete attributes.type
    }
    tagNameArr.push(">");
    tagName = tagNameArr.join("")
  }
  var element = doc.createElement(tagName);
  attributes && (goog.isString(attributes) ? element.className = attributes : goog.isArray(attributes) ? goog.dom.classes.add.apply(null, [element].concat(attributes)) : goog.dom.setProperties(element, attributes));
  2 < args.length && goog.dom.append_(doc, element, args, 2);
  return element
};
goog.dom.append_ = function $goog$dom$append_$(doc, parent, args, startIndex) {
  function childHandler(child) {
    child && parent.appendChild(goog.isString(child) ? doc.createTextNode(child) : child)
  }
  for(var i = startIndex;i < args.length;i++) {
    var arg = args[i];
    goog.isArrayLike(arg) && !goog.dom.isNodeLike(arg) ? goog.array.forEach(goog.dom.isNodeList(arg) ? goog.array.clone(arg) : arg, childHandler) : childHandler(arg)
  }
};
goog.dom.$dom = goog.dom.createDom;
goog.dom.createElement = function $goog$dom$createElement$(name) {
  return document.createElement(name)
};
goog.dom.createTextNode = function $goog$dom$createTextNode$(content) {
  return document.createTextNode(content)
};
goog.dom.createTable = function $goog$dom$createTable$(rows, columns, opt_fillWithNbsp) {
  return goog.dom.createTable_(document, rows, columns, !!opt_fillWithNbsp)
};
goog.dom.createTable_ = function $goog$dom$createTable_$(doc, rows, columns, fillWithNbsp) {
  for(var rowHtml = ["<tr>"], i = 0;i < columns;i++) {
    rowHtml.push(fillWithNbsp ? "<td>&nbsp;</td>" : "<td></td>")
  }
  rowHtml.push("</tr>");
  for(var rowHtml = rowHtml.join(""), totalHtml = ["<table>"], i = 0;i < rows;i++) {
    totalHtml.push(rowHtml)
  }
  totalHtml.push("</table>");
  var elem = doc.createElement(goog.dom.TagName.DIV);
  elem.innerHTML = totalHtml.join("");
  return elem.removeChild(elem.firstChild)
};
goog.dom.htmlToDocumentFragment = function $goog$dom$htmlToDocumentFragment$(htmlString) {
  return goog.dom.htmlToDocumentFragment_(document, htmlString)
};
goog.dom.htmlToDocumentFragment_ = function $goog$dom$htmlToDocumentFragment_$(doc, htmlString) {
  var tempDiv = doc.createElement("div");
  goog.dom.BrowserFeature.INNER_HTML_NEEDS_SCOPED_ELEMENT ? (tempDiv.innerHTML = "<br>" + htmlString, tempDiv.removeChild(tempDiv.firstChild)) : tempDiv.innerHTML = htmlString;
  if(1 == tempDiv.childNodes.length) {
    return tempDiv.removeChild(tempDiv.firstChild)
  }
  for(var fragment = doc.createDocumentFragment();tempDiv.firstChild;) {
    fragment.appendChild(tempDiv.firstChild)
  }
  return fragment
};
goog.dom.getCompatMode = function $goog$dom$getCompatMode$() {
  return goog.dom.isCss1CompatMode() ? "CSS1Compat" : "BackCompat"
};
goog.dom.isCss1CompatMode = function $goog$dom$isCss1CompatMode$() {
  return goog.dom.isCss1CompatMode_(document)
};
goog.dom.isCss1CompatMode_ = function $goog$dom$isCss1CompatMode_$(doc) {
  return goog.dom.COMPAT_MODE_KNOWN_ ? goog.dom.ASSUME_STANDARDS_MODE : "CSS1Compat" == doc.compatMode
};
goog.dom.canHaveChildren = function $goog$dom$canHaveChildren$(node) {
  if(node.nodeType != goog.dom.NodeType.ELEMENT) {
    return!1
  }
  switch(node.tagName) {
    case goog.dom.TagName.APPLET:
    ;
    case goog.dom.TagName.AREA:
    ;
    case goog.dom.TagName.BASE:
    ;
    case goog.dom.TagName.BR:
    ;
    case goog.dom.TagName.COL:
    ;
    case goog.dom.TagName.FRAME:
    ;
    case goog.dom.TagName.HR:
    ;
    case goog.dom.TagName.IMG:
    ;
    case goog.dom.TagName.INPUT:
    ;
    case goog.dom.TagName.IFRAME:
    ;
    case goog.dom.TagName.ISINDEX:
    ;
    case goog.dom.TagName.LINK:
    ;
    case goog.dom.TagName.NOFRAMES:
    ;
    case goog.dom.TagName.NOSCRIPT:
    ;
    case goog.dom.TagName.META:
    ;
    case goog.dom.TagName.OBJECT:
    ;
    case goog.dom.TagName.PARAM:
    ;
    case goog.dom.TagName.SCRIPT:
    ;
    case goog.dom.TagName.STYLE:
      return!1
  }
  return!0
};
goog.dom.appendChild = function $goog$dom$appendChild$(parent, child) {
  parent.appendChild(child)
};
goog.dom.append = function $goog$dom$append$(parent, var_args) {
  goog.dom.append_(goog.dom.getOwnerDocument(parent), parent, arguments, 1)
};
goog.dom.removeChildren = function $goog$dom$removeChildren$(node) {
  for(var child;child = node.firstChild;) {
    node.removeChild(child)
  }
};
goog.dom.insertSiblingBefore = function $goog$dom$insertSiblingBefore$(newNode, refNode) {
  refNode.parentNode && refNode.parentNode.insertBefore(newNode, refNode)
};
goog.dom.insertSiblingAfter = function $goog$dom$insertSiblingAfter$(newNode, refNode) {
  refNode.parentNode && refNode.parentNode.insertBefore(newNode, refNode.nextSibling)
};
goog.dom.insertChildAt = function $goog$dom$insertChildAt$(parent, child, index) {
  parent.insertBefore(child, parent.childNodes[index] || null)
};
goog.dom.removeNode = function $goog$dom$removeNode$(node) {
  return node && node.parentNode ? node.parentNode.removeChild(node) : null
};
goog.dom.replaceNode = function $goog$dom$replaceNode$(newNode, oldNode) {
  var parent = oldNode.parentNode;
  parent && parent.replaceChild(newNode, oldNode)
};
goog.dom.flattenElement = function $goog$dom$flattenElement$(element) {
  var child, parent = element.parentNode;
  if(parent && parent.nodeType != goog.dom.NodeType.DOCUMENT_FRAGMENT) {
    if(element.removeNode) {
      return element.removeNode(!1)
    }
    for(;child = element.firstChild;) {
      parent.insertBefore(child, element)
    }
    return goog.dom.removeNode(element)
  }
};
goog.dom.getChildren = function $goog$dom$getChildren$(element) {
  return goog.dom.BrowserFeature.CAN_USE_CHILDREN_ATTRIBUTE && void 0 != element.children ? element.children : goog.array.filter(element.childNodes, function(node) {
    return node.nodeType == goog.dom.NodeType.ELEMENT
  })
};
goog.dom.getFirstElementChild = function $goog$dom$getFirstElementChild$(node) {
  return void 0 != node.firstElementChild ? node.firstElementChild : goog.dom.getNextElementNode_(node.firstChild, !0)
};
goog.dom.getLastElementChild = function $goog$dom$getLastElementChild$(node) {
  return void 0 != node.lastElementChild ? node.lastElementChild : goog.dom.getNextElementNode_(node.lastChild, !1)
};
goog.dom.getNextElementSibling = function $goog$dom$getNextElementSibling$(node) {
  return void 0 != node.nextElementSibling ? node.nextElementSibling : goog.dom.getNextElementNode_(node.nextSibling, !0)
};
goog.dom.getPreviousElementSibling = function $goog$dom$getPreviousElementSibling$(node) {
  return void 0 != node.previousElementSibling ? node.previousElementSibling : goog.dom.getNextElementNode_(node.previousSibling, !1)
};
goog.dom.getNextElementNode_ = function $goog$dom$getNextElementNode_$(node, forward) {
  for(;node && node.nodeType != goog.dom.NodeType.ELEMENT;) {
    node = forward ? node.nextSibling : node.previousSibling
  }
  return node
};
goog.dom.getNextNode = function $goog$dom$getNextNode$(node) {
  if(!node) {
    return null
  }
  if(node.firstChild) {
    return node.firstChild
  }
  for(;node && !node.nextSibling;) {
    node = node.parentNode
  }
  return node ? node.nextSibling : null
};
goog.dom.getPreviousNode = function $goog$dom$getPreviousNode$(node) {
  if(!node) {
    return null
  }
  if(!node.previousSibling) {
    return node.parentNode
  }
  for(node = node.previousSibling;node && node.lastChild;) {
    node = node.lastChild
  }
  return node
};
goog.dom.isNodeLike = function $goog$dom$isNodeLike$(obj) {
  return goog.isObject(obj) && 0 < obj.nodeType
};
goog.dom.isElement = function $goog$dom$isElement$(obj) {
  return goog.isObject(obj) && obj.nodeType == goog.dom.NodeType.ELEMENT
};
goog.dom.isWindow = function $goog$dom$isWindow$(obj) {
  return goog.isObject(obj) && obj.window == obj
};
goog.dom.getParentElement = function $goog$dom$getParentElement$(element) {
  if(goog.dom.BrowserFeature.CAN_USE_PARENT_ELEMENT_PROPERTY) {
    return element.parentElement
  }
  var parent = element.parentNode;
  return goog.dom.isElement(parent) ? parent : null
};
goog.dom.contains = function $goog$dom$contains$(parent, descendant) {
  if(parent.contains && descendant.nodeType == goog.dom.NodeType.ELEMENT) {
    return parent == descendant || parent.contains(descendant)
  }
  if("undefined" != typeof parent.compareDocumentPosition) {
    return parent == descendant || Boolean(parent.compareDocumentPosition(descendant) & 16)
  }
  for(;descendant && parent != descendant;) {
    descendant = descendant.parentNode
  }
  return descendant == parent
};
goog.dom.compareNodeOrder = function $goog$dom$compareNodeOrder$(node1, node2) {
  if(node1 == node2) {
    return 0
  }
  if(node1.compareDocumentPosition) {
    return node1.compareDocumentPosition(node2) & 2 ? 1 : -1
  }
  if("sourceIndex" in node1 || node1.parentNode && "sourceIndex" in node1.parentNode) {
    var isElement1 = node1.nodeType == goog.dom.NodeType.ELEMENT, isElement2 = node2.nodeType == goog.dom.NodeType.ELEMENT;
    if(isElement1 && isElement2) {
      return node1.sourceIndex - node2.sourceIndex
    }
    var parent1 = node1.parentNode, parent2 = node2.parentNode;
    return parent1 == parent2 ? goog.dom.compareSiblingOrder_(node1, node2) : !isElement1 && goog.dom.contains(parent1, node2) ? -1 * goog.dom.compareParentsDescendantNodeIe_(node1, node2) : !isElement2 && goog.dom.contains(parent2, node1) ? goog.dom.compareParentsDescendantNodeIe_(node2, node1) : (isElement1 ? node1.sourceIndex : parent1.sourceIndex) - (isElement2 ? node2.sourceIndex : parent2.sourceIndex)
  }
  var doc = goog.dom.getOwnerDocument(node1), range1, range2;
  range1 = doc.createRange();
  range1.selectNode(node1);
  range1.collapse(!0);
  range2 = doc.createRange();
  range2.selectNode(node2);
  range2.collapse(!0);
  return range1.compareBoundaryPoints(goog.global.Range.START_TO_END, range2)
};
goog.dom.compareParentsDescendantNodeIe_ = function $goog$dom$compareParentsDescendantNodeIe_$(textNode, node) {
  var parent = textNode.parentNode;
  if(parent == node) {
    return-1
  }
  for(var sibling = node;sibling.parentNode != parent;) {
    sibling = sibling.parentNode
  }
  return goog.dom.compareSiblingOrder_(sibling, textNode)
};
goog.dom.compareSiblingOrder_ = function $goog$dom$compareSiblingOrder_$(node1, node2) {
  for(var s = node2;s = s.previousSibling;) {
    if(s == node1) {
      return-1
    }
  }
  return 1
};
goog.dom.findCommonAncestor = function $goog$dom$findCommonAncestor$(var_args) {
  var i, count = arguments.length;
  if(count) {
    if(1 == count) {
      return arguments[0]
    }
  }else {
    return null
  }
  var paths = [], minLength = Infinity;
  for(i = 0;i < count;i++) {
    for(var ancestors = [], node = arguments[i];node;) {
      ancestors.unshift(node), node = node.parentNode
    }
    paths.push(ancestors);
    minLength = Math.min(minLength, ancestors.length)
  }
  var output = null;
  for(i = 0;i < minLength;i++) {
    for(var first = paths[0][i], j = 1;j < count;j++) {
      if(first != paths[j][i]) {
        return output
      }
    }
    output = first
  }
  return output
};
goog.dom.getOwnerDocument = function $goog$dom$getOwnerDocument$(node) {
  return node.nodeType == goog.dom.NodeType.DOCUMENT ? node : node.ownerDocument || node.document
};
goog.dom.getFrameContentDocument = function $goog$dom$getFrameContentDocument$(frame) {
  var doc = frame.contentDocument || frame.contentWindow.document;
  return doc
};
goog.dom.getFrameContentWindow = function $goog$dom$getFrameContentWindow$(frame) {
  return frame.contentWindow || goog.dom.getWindow_(goog.dom.getFrameContentDocument(frame))
};
goog.dom.setTextContent = function $goog$dom$setTextContent$(element, text) {
  if("textContent" in element) {
    element.textContent = text
  }else {
    if(element.firstChild && element.firstChild.nodeType == goog.dom.NodeType.TEXT) {
      for(;element.lastChild != element.firstChild;) {
        element.removeChild(element.lastChild)
      }
      element.firstChild.data = text
    }else {
      goog.dom.removeChildren(element);
      var doc = goog.dom.getOwnerDocument(element);
      element.appendChild(doc.createTextNode(text))
    }
  }
};
goog.dom.getOuterHtml = function $goog$dom$getOuterHtml$(element) {
  if("outerHTML" in element) {
    return element.outerHTML
  }
  var doc = goog.dom.getOwnerDocument(element), div = doc.createElement("div");
  div.appendChild(element.cloneNode(!0));
  return div.innerHTML
};
goog.dom.findNode = function $goog$dom$findNode$(root, p) {
  var rv = [], found = goog.dom.findNodes_(root, p, rv, !0);
  return found ? rv[0] : void 0
};
goog.dom.findNodes = function $goog$dom$findNodes$(root, p) {
  var rv = [];
  goog.dom.findNodes_(root, p, rv, !1);
  return rv
};
goog.dom.findNodes_ = function $goog$dom$findNodes_$(root, p, rv, findOne) {
  if(null != root) {
    for(var child = root.firstChild;child;) {
      if(p(child) && (rv.push(child), findOne) || goog.dom.findNodes_(child, p, rv, findOne)) {
        return!0
      }
      child = child.nextSibling
    }
  }
  return!1
};
goog.dom.TAGS_TO_IGNORE_ = {SCRIPT:1, STYLE:1, HEAD:1, IFRAME:1, OBJECT:1};
goog.dom.PREDEFINED_TAG_VALUES_ = {IMG:" ", BR:"\n"};
goog.dom.isFocusableTabIndex = function $goog$dom$isFocusableTabIndex$(element) {
  var attrNode = element.getAttributeNode("tabindex");
  if(attrNode && attrNode.specified) {
    var index = element.tabIndex;
    return goog.isNumber(index) && 0 <= index && 32768 > index
  }
  return!1
};
goog.dom.setFocusableTabIndex = function $goog$dom$setFocusableTabIndex$(element, enable) {
  enable ? element.tabIndex = 0 : (element.tabIndex = -1, element.removeAttribute("tabIndex"))
};
goog.dom.getTextContent = function $goog$dom$getTextContent$(node) {
  var textContent;
  if(goog.dom.BrowserFeature.CAN_USE_INNER_TEXT && "innerText" in node) {
    textContent = goog.string.canonicalizeNewlines(node.innerText)
  }else {
    var buf = [];
    goog.dom.getTextContent_(node, buf, !0);
    textContent = buf.join("")
  }
  textContent = textContent.replace(/ \xAD /g, " ").replace(/\xAD/g, "");
  textContent = textContent.replace(/\u200B/g, "");
  goog.dom.BrowserFeature.CAN_USE_INNER_TEXT || (textContent = textContent.replace(/ +/g, " "));
  " " != textContent && (textContent = textContent.replace(/^\s*/, ""));
  return textContent
};
goog.dom.getRawTextContent = function $goog$dom$getRawTextContent$(node) {
  var buf = [];
  goog.dom.getTextContent_(node, buf, !1);
  return buf.join("")
};
goog.dom.getTextContent_ = function $goog$dom$getTextContent_$(node, buf, normalizeWhitespace) {
  if(!(node.nodeName in goog.dom.TAGS_TO_IGNORE_)) {
    if(node.nodeType == goog.dom.NodeType.TEXT) {
      normalizeWhitespace ? buf.push(("" + node.nodeValue).replace(/(\r\n|\r|\n)/g, "")) : buf.push(node.nodeValue)
    }else {
      if(node.nodeName in goog.dom.PREDEFINED_TAG_VALUES_) {
        buf.push(goog.dom.PREDEFINED_TAG_VALUES_[node.nodeName])
      }else {
        for(var child = node.firstChild;child;) {
          goog.dom.getTextContent_(child, buf, normalizeWhitespace), child = child.nextSibling
        }
      }
    }
  }
};
goog.dom.getNodeTextLength = function $goog$dom$getNodeTextLength$(node) {
  return goog.dom.getTextContent(node).length
};
goog.dom.getNodeTextOffset = function $goog$dom$getNodeTextOffset$(node, opt_offsetParent) {
  for(var root = opt_offsetParent || goog.dom.getOwnerDocument(node).body, buf = [];node && node != root;) {
    for(var cur = node;cur = cur.previousSibling;) {
      buf.unshift(goog.dom.getTextContent(cur))
    }
    node = node.parentNode
  }
  return goog.string.trimLeft(buf.join("")).replace(/ +/g, " ").length
};
goog.dom.getNodeAtOffset = function $goog$dom$getNodeAtOffset$(parent, offset, opt_result) {
  for(var stack = [parent], pos = 0, cur;0 < stack.length && pos < offset;) {
    if(cur = stack.pop(), !(cur.nodeName in goog.dom.TAGS_TO_IGNORE_)) {
      if(cur.nodeType == goog.dom.NodeType.TEXT) {
        var text = cur.nodeValue.replace(/(\r\n|\r|\n)/g, "").replace(/ +/g, " "), pos = pos + text.length
      }else {
        if(cur.nodeName in goog.dom.PREDEFINED_TAG_VALUES_) {
          pos += goog.dom.PREDEFINED_TAG_VALUES_[cur.nodeName].length
        }else {
          for(var i = cur.childNodes.length - 1;0 <= i;i--) {
            stack.push(cur.childNodes[i])
          }
        }
      }
    }
  }
  goog.isObject(opt_result) && (opt_result.remainder = cur ? cur.nodeValue.length + offset - pos - 1 : 0, opt_result.node = cur);
  return cur
};
goog.dom.isNodeList = function $goog$dom$isNodeList$(val) {
  if(val && "number" == typeof val.length) {
    if(goog.isObject(val)) {
      return"function" == typeof val.item || "string" == typeof val.item
    }
    if(goog.isFunction(val)) {
      return"function" == typeof val.item
    }
  }
  return!1
};
goog.dom.getAncestorByTagNameAndClass = function $goog$dom$getAncestorByTagNameAndClass$(element, opt_tag, opt_class) {
  if(!opt_tag && !opt_class) {
    return null
  }
  var tagName = opt_tag ? opt_tag.toUpperCase() : null;
  return goog.dom.getAncestor(element, function(node) {
    return(!tagName || node.nodeName == tagName) && (!opt_class || goog.dom.classes.has(node, opt_class))
  }, !0)
};
goog.dom.getAncestorByClass = function $goog$dom$getAncestorByClass$(element, className) {
  return goog.dom.getAncestorByTagNameAndClass(element, null, className)
};
goog.dom.getAncestor = function $goog$dom$getAncestor$(element, matcher, opt_includeNode, opt_maxSearchSteps) {
  opt_includeNode || (element = element.parentNode);
  for(var ignoreSearchSteps = null == opt_maxSearchSteps, steps = 0;element && (ignoreSearchSteps || steps <= opt_maxSearchSteps);) {
    if(matcher(element)) {
      return element
    }
    element = element.parentNode;
    steps++
  }
  return null
};
goog.dom.getActiveElement = function $goog$dom$getActiveElement$(doc) {
  try {
    return doc && doc.activeElement
  }catch(e) {
  }
  return null
};
goog.dom.DomHelper = function $goog$dom$DomHelper$(opt_document) {
  this.document_ = opt_document || goog.global.document || document
};
goog.dom.DomHelper.prototype.getDomHelper = goog.dom.getDomHelper;
goog.dom.DomHelper.prototype.setDocument = function $goog$dom$DomHelper$$setDocument$(document) {
  this.document_ = document
};
goog.dom.DomHelper.prototype.getDocument = function $goog$dom$DomHelper$$getDocument$() {
  return this.document_
};
goog.dom.DomHelper.prototype.getElement = function $goog$dom$DomHelper$$getElement$(element) {
  return goog.isString(element) ? this.document_.getElementById(element) : element
};
goog.dom.DomHelper.prototype.$ = goog.dom.DomHelper.prototype.getElement;
goog.dom.DomHelper.prototype.getElementsByTagNameAndClass = function $goog$dom$DomHelper$$getElementsByTagNameAndClass$(opt_tag, opt_class, opt_el) {
  return goog.dom.getElementsByTagNameAndClass_(this.document_, opt_tag, opt_class, opt_el)
};
goog.dom.DomHelper.prototype.getElementsByClass = function $goog$dom$DomHelper$$getElementsByClass$(className, opt_el) {
  var doc = opt_el || this.document_;
  return goog.dom.getElementsByClass(className, doc)
};
goog.dom.DomHelper.prototype.getElementByClass = function $goog$dom$DomHelper$$getElementByClass$(className, opt_el) {
  var doc = opt_el || this.document_;
  return goog.dom.getElementByClass(className, doc)
};
goog.dom.DomHelper.prototype.$$ = goog.dom.DomHelper.prototype.getElementsByTagNameAndClass;
goog.dom.DomHelper.prototype.setProperties = goog.dom.setProperties;
goog.dom.DomHelper.prototype.getViewportSize = function $goog$dom$DomHelper$$getViewportSize$(opt_window) {
  return goog.dom.getViewportSize(opt_window || this.getWindow())
};
goog.dom.DomHelper.prototype.getDocumentHeight = function $goog$dom$DomHelper$$getDocumentHeight$() {
  return goog.dom.getDocumentHeight_(this.getWindow())
};
goog.dom.DomHelper.prototype.createDom = function $goog$dom$DomHelper$$createDom$(tagName, opt_attributes, var_args) {
  return goog.dom.createDom_(this.document_, arguments)
};
goog.dom.DomHelper.prototype.$dom = goog.dom.DomHelper.prototype.createDom;
goog.dom.DomHelper.prototype.createElement = function $goog$dom$DomHelper$$createElement$(name) {
  return this.document_.createElement(name)
};
goog.dom.DomHelper.prototype.createTextNode = function $goog$dom$DomHelper$$createTextNode$(content) {
  return this.document_.createTextNode(content)
};
goog.dom.DomHelper.prototype.createTable = function $goog$dom$DomHelper$$createTable$(rows, columns, opt_fillWithNbsp) {
  return goog.dom.createTable_(this.document_, rows, columns, !!opt_fillWithNbsp)
};
goog.dom.DomHelper.prototype.htmlToDocumentFragment = function $goog$dom$DomHelper$$htmlToDocumentFragment$(htmlString) {
  return goog.dom.htmlToDocumentFragment_(this.document_, htmlString)
};
goog.dom.DomHelper.prototype.getCompatMode = function $goog$dom$DomHelper$$getCompatMode$() {
  return this.isCss1CompatMode() ? "CSS1Compat" : "BackCompat"
};
goog.dom.DomHelper.prototype.isCss1CompatMode = function $goog$dom$DomHelper$$isCss1CompatMode$() {
  return goog.dom.isCss1CompatMode_(this.document_)
};
goog.dom.DomHelper.prototype.getWindow = function $goog$dom$DomHelper$$getWindow$() {
  return goog.dom.getWindow_(this.document_)
};
goog.dom.DomHelper.prototype.getDocumentScrollElement = function $goog$dom$DomHelper$$getDocumentScrollElement$() {
  return goog.dom.getDocumentScrollElement_(this.document_)
};
goog.dom.DomHelper.prototype.getDocumentScroll = function $goog$dom$DomHelper$$getDocumentScroll$() {
  return goog.dom.getDocumentScroll_(this.document_)
};
goog.dom.DomHelper.prototype.appendChild = goog.dom.appendChild;
goog.dom.DomHelper.prototype.append = goog.dom.append;
goog.dom.DomHelper.prototype.removeChildren = goog.dom.removeChildren;
goog.dom.DomHelper.prototype.insertSiblingBefore = goog.dom.insertSiblingBefore;
goog.dom.DomHelper.prototype.insertSiblingAfter = goog.dom.insertSiblingAfter;
goog.dom.DomHelper.prototype.removeNode = goog.dom.removeNode;
goog.dom.DomHelper.prototype.replaceNode = goog.dom.replaceNode;
goog.dom.DomHelper.prototype.flattenElement = goog.dom.flattenElement;
goog.dom.DomHelper.prototype.getFirstElementChild = goog.dom.getFirstElementChild;
goog.dom.DomHelper.prototype.getLastElementChild = goog.dom.getLastElementChild;
goog.dom.DomHelper.prototype.getNextElementSibling = goog.dom.getNextElementSibling;
goog.dom.DomHelper.prototype.getPreviousElementSibling = goog.dom.getPreviousElementSibling;
goog.dom.DomHelper.prototype.getNextNode = goog.dom.getNextNode;
goog.dom.DomHelper.prototype.getPreviousNode = goog.dom.getPreviousNode;
goog.dom.DomHelper.prototype.isNodeLike = goog.dom.isNodeLike;
goog.dom.DomHelper.prototype.contains = goog.dom.contains;
goog.dom.DomHelper.prototype.getOwnerDocument = goog.dom.getOwnerDocument;
goog.dom.DomHelper.prototype.getFrameContentDocument = goog.dom.getFrameContentDocument;
goog.dom.DomHelper.prototype.getFrameContentWindow = goog.dom.getFrameContentWindow;
goog.dom.DomHelper.prototype.setTextContent = goog.dom.setTextContent;
goog.dom.DomHelper.prototype.findNode = goog.dom.findNode;
goog.dom.DomHelper.prototype.findNodes = goog.dom.findNodes;
goog.dom.DomHelper.prototype.getTextContent = goog.dom.getTextContent;
goog.dom.DomHelper.prototype.getNodeTextLength = goog.dom.getNodeTextLength;
goog.dom.DomHelper.prototype.getNodeTextOffset = goog.dom.getNodeTextOffset;
goog.dom.DomHelper.prototype.getAncestorByTagNameAndClass = goog.dom.getAncestorByTagNameAndClass;
goog.dom.DomHelper.prototype.getAncestorByClass = goog.dom.getAncestorByClass;
goog.dom.DomHelper.prototype.getAncestor = goog.dom.getAncestor;
goog.disposable = {};
goog.disposable.IDisposable = function $goog$disposable$IDisposable$() {
};
goog.Disposable = function $goog$Disposable$() {
  goog.Disposable.ENABLE_MONITORING && (goog.Disposable.instances_[goog.getUid(this)] = this)
};
goog.Disposable.ENABLE_MONITORING = !1;
goog.Disposable.instances_ = {};
goog.Disposable.getUndisposedObjects = function $goog$Disposable$getUndisposedObjects$() {
  var ret = [], id;
  for(id in goog.Disposable.instances_) {
    goog.Disposable.instances_.hasOwnProperty(id) && ret.push(goog.Disposable.instances_[Number(id)])
  }
  return ret
};
goog.Disposable.clearUndisposedObjects = function $goog$Disposable$clearUndisposedObjects$() {
  goog.Disposable.instances_ = {}
};
goog.Disposable.prototype.disposed_ = !1;
goog.Disposable.prototype.isDisposed = function $goog$Disposable$$isDisposed$() {
  return this.disposed_
};
goog.Disposable.prototype.dispose = function $goog$Disposable$$dispose$() {
  if(!this.disposed_ && (this.disposed_ = !0, this.disposeInternal(), goog.Disposable.ENABLE_MONITORING)) {
    var uid = goog.getUid(this);
    if(!goog.Disposable.instances_.hasOwnProperty(uid)) {
      throw Error(this + " did not call the goog.Disposable base constructor or was disposed of after a clearUndisposedObjects call");
    }
    delete goog.Disposable.instances_[uid]
  }
};
goog.Disposable.prototype.disposeInternal = function $goog$Disposable$$disposeInternal$() {
  this.dependentDisposables_ && goog.disposeAll.apply(null, this.dependentDisposables_)
};
goog.dispose = function $goog$dispose$(obj) {
  obj && "function" == typeof obj.dispose && obj.dispose()
};
goog.disposeAll = function $goog$disposeAll$(var_args) {
  for(var i = 0, len = arguments.length;i < len;++i) {
    var disposable = arguments[i];
    goog.isArrayLike(disposable) ? goog.disposeAll.apply(null, disposable) : goog.dispose(disposable)
  }
};
goog.events = {};
goog.events.Event = function $goog$events$Event$(type, opt_target) {
  goog.Disposable.call(this);
  this.type = type;
  this.currentTarget = this.target = opt_target
};
goog.inherits(goog.events.Event, goog.Disposable);
goog.events.Event.prototype.disposeInternal = function $goog$events$Event$$disposeInternal$() {
  delete this.type;
  delete this.target;
  delete this.currentTarget
};
goog.events.Event.prototype.propagationStopped_ = !1;
goog.events.Event.prototype.defaultPrevented = !1;
goog.events.Event.prototype.returnValue_ = !0;
goog.events.Event.prototype.stopPropagation = function $goog$events$Event$$stopPropagation$() {
  this.propagationStopped_ = !0
};
goog.events.Event.prototype.preventDefault = function $goog$events$Event$$preventDefault$() {
  this.defaultPrevented = !0;
  this.returnValue_ = !1
};
goog.events.Event.stopPropagation = function $goog$events$Event$stopPropagation$(e) {
  e.stopPropagation()
};
goog.events.Event.preventDefault = function $goog$events$Event$preventDefault$(e) {
  e.preventDefault()
};
goog.debug.entryPointRegistry = {};
goog.debug.EntryPointMonitor = function $goog$debug$EntryPointMonitor$() {
};
goog.debug.entryPointRegistry.refList_ = [];
goog.debug.entryPointRegistry.monitors_ = [];
goog.debug.entryPointRegistry.monitorsMayExist_ = !1;
goog.debug.entryPointRegistry.register = function $goog$debug$entryPointRegistry$register$(callback) {
  goog.debug.entryPointRegistry.refList_[goog.debug.entryPointRegistry.refList_.length] = callback;
  if(goog.debug.entryPointRegistry.monitorsMayExist_) {
    for(var monitors = goog.debug.entryPointRegistry.monitors_, i = 0;i < monitors.length;i++) {
      callback(goog.bind(monitors[i].wrap, monitors[i]))
    }
  }
};
goog.debug.entryPointRegistry.monitorAll = function $goog$debug$entryPointRegistry$monitorAll$(monitor) {
  goog.debug.entryPointRegistry.monitorsMayExist_ = !0;
  for(var transformer = goog.bind(monitor.wrap, monitor), i = 0;i < goog.debug.entryPointRegistry.refList_.length;i++) {
    goog.debug.entryPointRegistry.refList_[i](transformer)
  }
  goog.debug.entryPointRegistry.monitors_.push(monitor)
};
goog.debug.entryPointRegistry.unmonitorAllIfPossible = function $goog$debug$entryPointRegistry$unmonitorAllIfPossible$(monitor) {
  var monitors = goog.debug.entryPointRegistry.monitors_;
  goog.asserts.assert(monitor == monitors[monitors.length - 1], "Only the most recent monitor can be unwrapped.");
  for(var transformer = goog.bind(monitor.unwrap, monitor), i = 0;i < goog.debug.entryPointRegistry.refList_.length;i++) {
    goog.debug.entryPointRegistry.refList_[i](transformer)
  }
  monitors.length--
};
goog.debug.errorHandlerWeakDep = {protectEntryPoint:function $goog$debug$errorHandlerWeakDep$protectEntryPoint$(fn) {
  return fn
}};
goog.reflect = {};
goog.reflect.object = function $goog$reflect$object$(type, object) {
  return object
};
goog.reflect.sinkValue = function $goog$reflect$sinkValue$(x) {
  goog.reflect.sinkValue[" "](x);
  return x
};
goog.reflect.sinkValue[" "] = goog.nullFunction;
goog.reflect.canAccessProperty = function $goog$reflect$canAccessProperty$(obj, prop) {
  try {
    return goog.reflect.sinkValue(obj[prop]), !0
  }catch(e) {
  }
  return!1
};
goog.events.BrowserFeature = {HAS_W3C_BUTTON:!goog.userAgent.IE || goog.userAgent.isDocumentMode(9), HAS_W3C_EVENT_SUPPORT:!goog.userAgent.IE || goog.userAgent.isDocumentMode(9), SET_KEY_CODE_TO_PREVENT_DEFAULT:goog.userAgent.IE && !goog.userAgent.isVersion("8"), HAS_NAVIGATOR_ONLINE_PROPERTY:!goog.userAgent.WEBKIT || goog.userAgent.isVersion("528"), HAS_HTML5_NETWORK_EVENT_SUPPORT:goog.userAgent.GECKO && goog.userAgent.isVersion("1.9b") || goog.userAgent.IE && goog.userAgent.isVersion("8") || goog.userAgent.OPERA && 
goog.userAgent.isVersion("9.5") || goog.userAgent.WEBKIT && goog.userAgent.isVersion("528"), HTML5_NETWORK_EVENTS_FIRE_ON_BODY:goog.userAgent.GECKO && !goog.userAgent.isVersion("8") || goog.userAgent.IE && !goog.userAgent.isVersion("9")};
goog.events.EventType = {CLICK:"click", DBLCLICK:"dblclick", MOUSEDOWN:"mousedown", MOUSEUP:"mouseup", MOUSEOVER:"mouseover", MOUSEOUT:"mouseout", MOUSEMOVE:"mousemove", SELECTSTART:"selectstart", KEYPRESS:"keypress", KEYDOWN:"keydown", KEYUP:"keyup", BLUR:"blur", FOCUS:"focus", DEACTIVATE:"deactivate", FOCUSIN:goog.userAgent.IE ? "focusin" : "DOMFocusIn", FOCUSOUT:goog.userAgent.IE ? "focusout" : "DOMFocusOut", CHANGE:"change", SELECT:"select", SUBMIT:"submit", INPUT:"input", PROPERTYCHANGE:"propertychange", 
DRAGSTART:"dragstart", DRAGENTER:"dragenter", DRAGOVER:"dragover", DRAGLEAVE:"dragleave", DROP:"drop", TOUCHSTART:"touchstart", TOUCHMOVE:"touchmove", TOUCHEND:"touchend", TOUCHCANCEL:"touchcancel", CONTEXTMENU:"contextmenu", ERROR:"error", HELP:"help", LOAD:"load", LOSECAPTURE:"losecapture", READYSTATECHANGE:"readystatechange", RESIZE:"resize", SCROLL:"scroll", UNLOAD:"unload", HASHCHANGE:"hashchange", PAGEHIDE:"pagehide", PAGESHOW:"pageshow", POPSTATE:"popstate", COPY:"copy", PASTE:"paste", CUT:"cut", 
BEFORECOPY:"beforecopy", BEFORECUT:"beforecut", BEFOREPASTE:"beforepaste", MESSAGE:"message", CONNECT:"connect", TRANSITIONEND:goog.userAgent.WEBKIT ? "webkitTransitionEnd" : goog.userAgent.OPERA ? "oTransitionEnd" : "transitionend"};
goog.events.BrowserEvent = function $goog$events$BrowserEvent$(opt_e, opt_currentTarget) {
  opt_e && this.init(opt_e, opt_currentTarget)
};
goog.inherits(goog.events.BrowserEvent, goog.events.Event);
goog.events.BrowserEvent.MouseButton = {LEFT:0, MIDDLE:1, RIGHT:2};
goog.events.BrowserEvent.IEButtonMap = [1, 4, 2];
goog.events.BrowserEvent.prototype.target = null;
goog.events.BrowserEvent.prototype.relatedTarget = null;
goog.events.BrowserEvent.prototype.offsetX = 0;
goog.events.BrowserEvent.prototype.offsetY = 0;
goog.events.BrowserEvent.prototype.clientX = 0;
goog.events.BrowserEvent.prototype.clientY = 0;
goog.events.BrowserEvent.prototype.screenX = 0;
goog.events.BrowserEvent.prototype.screenY = 0;
goog.events.BrowserEvent.prototype.button = 0;
goog.events.BrowserEvent.prototype.keyCode = 0;
goog.events.BrowserEvent.prototype.charCode = 0;
goog.events.BrowserEvent.prototype.ctrlKey = !1;
goog.events.BrowserEvent.prototype.altKey = !1;
goog.events.BrowserEvent.prototype.shiftKey = !1;
goog.events.BrowserEvent.prototype.metaKey = !1;
goog.events.BrowserEvent.prototype.platformModifierKey = !1;
goog.events.BrowserEvent.prototype.event_ = null;
goog.events.BrowserEvent.prototype.init = function $goog$events$BrowserEvent$$init$(e, opt_currentTarget) {
  var type = this.type = e.type;
  goog.events.Event.call(this, type);
  this.target = e.target || e.srcElement;
  this.currentTarget = opt_currentTarget;
  var relatedTarget = e.relatedTarget;
  relatedTarget ? goog.userAgent.GECKO && (goog.reflect.canAccessProperty(relatedTarget, "nodeName") || (relatedTarget = null)) : type == goog.events.EventType.MOUSEOVER ? relatedTarget = e.fromElement : type == goog.events.EventType.MOUSEOUT && (relatedTarget = e.toElement);
  this.relatedTarget = relatedTarget;
  this.offsetX = goog.userAgent.WEBKIT || void 0 !== e.offsetX ? e.offsetX : e.layerX;
  this.offsetY = goog.userAgent.WEBKIT || void 0 !== e.offsetY ? e.offsetY : e.layerY;
  this.clientX = void 0 !== e.clientX ? e.clientX : e.pageX;
  this.clientY = void 0 !== e.clientY ? e.clientY : e.pageY;
  this.screenX = e.screenX || 0;
  this.screenY = e.screenY || 0;
  this.button = e.button;
  this.keyCode = e.keyCode || 0;
  this.charCode = e.charCode || ("keypress" == type ? e.keyCode : 0);
  this.ctrlKey = e.ctrlKey;
  this.altKey = e.altKey;
  this.shiftKey = e.shiftKey;
  this.metaKey = e.metaKey;
  this.platformModifierKey = goog.userAgent.MAC ? e.metaKey : e.ctrlKey;
  this.state = e.state;
  this.event_ = e;
  e.defaultPrevented && this.preventDefault();
  delete this.propagationStopped_
};
goog.events.BrowserEvent.prototype.isButton = function $goog$events$BrowserEvent$$isButton$(button) {
  return goog.events.BrowserFeature.HAS_W3C_BUTTON ? this.event_.button == button : "click" == this.type ? button == goog.events.BrowserEvent.MouseButton.LEFT : !!(this.event_.button & goog.events.BrowserEvent.IEButtonMap[button])
};
goog.events.BrowserEvent.prototype.isMouseActionButton = function $goog$events$BrowserEvent$$isMouseActionButton$() {
  return this.isButton(goog.events.BrowserEvent.MouseButton.LEFT) && !(goog.userAgent.WEBKIT && goog.userAgent.MAC && this.ctrlKey)
};
goog.events.BrowserEvent.prototype.stopPropagation = function $goog$events$BrowserEvent$$stopPropagation$() {
  goog.events.BrowserEvent.superClass_.stopPropagation.call(this);
  this.event_.stopPropagation ? this.event_.stopPropagation() : this.event_.cancelBubble = !0
};
goog.events.BrowserEvent.prototype.preventDefault = function $goog$events$BrowserEvent$$preventDefault$() {
  goog.events.BrowserEvent.superClass_.preventDefault.call(this);
  var be = this.event_;
  if(be.preventDefault) {
    be.preventDefault()
  }else {
    if(be.returnValue = !1, goog.events.BrowserFeature.SET_KEY_CODE_TO_PREVENT_DEFAULT) {
      try {
        if(be.ctrlKey || 112 <= be.keyCode && 123 >= be.keyCode) {
          be.keyCode = -1
        }
      }catch(ex) {
      }
    }
  }
};
goog.events.BrowserEvent.prototype.getBrowserEvent = function $goog$events$BrowserEvent$$getBrowserEvent$() {
  return this.event_
};
goog.events.BrowserEvent.prototype.disposeInternal = function $goog$events$BrowserEvent$$disposeInternal$() {
  goog.events.BrowserEvent.superClass_.disposeInternal.call(this);
  this.relatedTarget = this.currentTarget = this.target = this.event_ = null
};
goog.events.EventWrapper = function $goog$events$EventWrapper$() {
};
goog.events.EventWrapper.prototype.listen = function $goog$events$EventWrapper$$listen$() {
};
goog.events.EventWrapper.prototype.unlisten = function $goog$events$EventWrapper$$unlisten$() {
};
goog.events.Listener = function $goog$events$Listener$() {
};
goog.events.Listener.counter_ = 0;
goog.events.Listener.prototype.key = 0;
goog.events.Listener.prototype.removed = !1;
goog.events.Listener.prototype.callOnce = !1;
goog.events.Listener.prototype.init = function $goog$events$Listener$$init$(listener, proxy, src, type, capture, opt_handler) {
  if(goog.isFunction(listener)) {
    this.isFunctionListener_ = !0
  }else {
    if(listener && listener.handleEvent && goog.isFunction(listener.handleEvent)) {
      this.isFunctionListener_ = !1
    }else {
      throw Error("Invalid listener argument");
    }
  }
  this.listener = listener;
  this.proxy = proxy;
  this.src = src;
  this.type = type;
  this.capture = !!capture;
  this.handler = opt_handler;
  this.callOnce = !1;
  this.key = ++goog.events.Listener.counter_;
  this.removed = !1
};
goog.events.Listener.prototype.handleEvent = function $goog$events$Listener$$handleEvent$(eventObject) {
  return this.isFunctionListener_ ? this.listener.call(this.handler || this.src, eventObject) : this.listener.handleEvent.call(this.listener, eventObject)
};
goog.events.ASSUME_GOOD_GC = !1;
goog.events.listeners_ = {};
goog.events.listenerTree_ = {};
goog.events.sources_ = {};
goog.events.onString_ = "on";
goog.events.onStringMap_ = {};
goog.events.keySeparator_ = "_";
goog.events.listen = function $goog$events$listen$(src, type, listener, opt_capt, opt_handler) {
  if(type) {
    if(goog.isArray(type)) {
      for(var i = 0;i < type.length;i++) {
        goog.events.listen(src, type[i], listener, opt_capt, opt_handler)
      }
      return null
    }
    var capture = !!opt_capt, map = goog.events.listenerTree_;
    type in map || (map[type] = {count_:0, remaining_:0});
    map = map[type];
    capture in map || (map[capture] = {count_:0, remaining_:0}, map.count_++);
    var map = map[capture], srcUid = goog.getUid(src), listenerArray, listenerObj;
    map.remaining_++;
    if(map[srcUid]) {
      listenerArray = map[srcUid];
      for(i = 0;i < listenerArray.length;i++) {
        if(listenerObj = listenerArray[i], listenerObj.listener == listener && listenerObj.handler == opt_handler) {
          if(listenerObj.removed) {
            break
          }
          return listenerArray[i].key
        }
      }
    }else {
      listenerArray = map[srcUid] = [], map.count_++
    }
    var proxy = goog.events.getProxy();
    proxy.src = src;
    listenerObj = new goog.events.Listener;
    listenerObj.init(listener, proxy, src, type, capture, opt_handler);
    var key = listenerObj.key;
    proxy.key = key;
    listenerArray.push(listenerObj);
    goog.events.listeners_[key] = listenerObj;
    goog.events.sources_[srcUid] || (goog.events.sources_[srcUid] = []);
    goog.events.sources_[srcUid].push(listenerObj);
    src.addEventListener ? (src == goog.global || !src.customEvent_) && src.addEventListener(type, proxy, capture) : src.attachEvent(goog.events.getOnString_(type), proxy);
    return key
  }
  throw Error("Invalid event type");
};
goog.events.getProxy = function $goog$events$getProxy$() {
  var proxyCallbackFunction = goog.events.handleBrowserEvent_, f = goog.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT ? function(eventObject) {
    return proxyCallbackFunction.call(f.src, f.key, eventObject)
  } : function(eventObject) {
    var v = proxyCallbackFunction.call(f.src, f.key, eventObject);
    if(!v) {
      return v
    }
  };
  return f
};
goog.events.listenOnce = function $goog$events$listenOnce$(src, type, listener, opt_capt, opt_handler) {
  if(goog.isArray(type)) {
    for(var i = 0;i < type.length;i++) {
      goog.events.listenOnce(src, type[i], listener, opt_capt, opt_handler)
    }
    return null
  }
  var key = goog.events.listen(src, type, listener, opt_capt, opt_handler), listenerObj = goog.events.listeners_[key];
  listenerObj.callOnce = !0;
  return key
};
goog.events.listenWithWrapper = function $goog$events$listenWithWrapper$(src, wrapper, listener, opt_capt, opt_handler) {
  wrapper.listen(src, listener, opt_capt, opt_handler)
};
goog.events.unlisten = function $goog$events$unlisten$(src, type, listener, opt_capt, opt_handler) {
  if(goog.isArray(type)) {
    for(var i = 0;i < type.length;i++) {
      goog.events.unlisten(src, type[i], listener, opt_capt, opt_handler)
    }
    return null
  }
  var capture = !!opt_capt, listenerArray = goog.events.getListeners_(src, type, capture);
  if(!listenerArray) {
    return!1
  }
  for(i = 0;i < listenerArray.length;i++) {
    if(listenerArray[i].listener == listener && listenerArray[i].capture == capture && listenerArray[i].handler == opt_handler) {
      return goog.events.unlistenByKey(listenerArray[i].key)
    }
  }
  return!1
};
goog.events.unlistenByKey = function $goog$events$unlistenByKey$(key) {
  if(!goog.events.listeners_[key]) {
    return!1
  }
  var listener = goog.events.listeners_[key];
  if(listener.removed) {
    return!1
  }
  var src = listener.src, type = listener.type, proxy = listener.proxy, capture = listener.capture;
  src.removeEventListener ? (src == goog.global || !src.customEvent_) && src.removeEventListener(type, proxy, capture) : src.detachEvent && src.detachEvent(goog.events.getOnString_(type), proxy);
  var srcUid = goog.getUid(src), listenerArray = goog.events.listenerTree_[type][capture][srcUid];
  if(goog.events.sources_[srcUid]) {
    var sourcesArray = goog.events.sources_[srcUid];
    goog.array.remove(sourcesArray, listener);
    0 == sourcesArray.length && delete goog.events.sources_[srcUid]
  }
  listener.removed = !0;
  listenerArray.needsCleanup_ = !0;
  goog.events.cleanUp_(type, capture, srcUid, listenerArray);
  delete goog.events.listeners_[key];
  return!0
};
goog.events.unlistenWithWrapper = function $goog$events$unlistenWithWrapper$(src, wrapper, listener, opt_capt, opt_handler) {
  wrapper.unlisten(src, listener, opt_capt, opt_handler)
};
goog.events.cleanUp_ = function $goog$events$cleanUp_$(type, capture, srcUid, listenerArray) {
  if(!listenerArray.locked_ && listenerArray.needsCleanup_) {
    for(var oldIndex = 0, newIndex = 0;oldIndex < listenerArray.length;oldIndex++) {
      if(listenerArray[oldIndex].removed) {
        var proxy = listenerArray[oldIndex].proxy;
        proxy.src = null
      }else {
        oldIndex != newIndex && (listenerArray[newIndex] = listenerArray[oldIndex]), newIndex++
      }
    }
    listenerArray.length = newIndex;
    listenerArray.needsCleanup_ = !1;
    0 == newIndex && (delete goog.events.listenerTree_[type][capture][srcUid], goog.events.listenerTree_[type][capture].count_--, 0 == goog.events.listenerTree_[type][capture].count_ && (delete goog.events.listenerTree_[type][capture], goog.events.listenerTree_[type].count_--), 0 == goog.events.listenerTree_[type].count_ && delete goog.events.listenerTree_[type])
  }
};
goog.events.removeAll = function $goog$events$removeAll$(opt_obj, opt_type, opt_capt) {
  var count = 0, noObj = null == opt_obj, noType = null == opt_type, noCapt = null == opt_capt, opt_capt = !!opt_capt;
  if(noObj) {
    goog.object.forEach(goog.events.sources_, function(listeners) {
      for(var i = listeners.length - 1;0 <= i;i--) {
        var listener = listeners[i];
        if((noType || opt_type == listener.type) && (noCapt || opt_capt == listener.capture)) {
          goog.events.unlistenByKey(listener.key), count++
        }
      }
    })
  }else {
    var srcUid = goog.getUid(opt_obj);
    if(goog.events.sources_[srcUid]) {
      for(var sourcesArray = goog.events.sources_[srcUid], i$$0 = sourcesArray.length - 1;0 <= i$$0;i$$0--) {
        var listener$$0 = sourcesArray[i$$0];
        if((noType || opt_type == listener$$0.type) && (noCapt || opt_capt == listener$$0.capture)) {
          goog.events.unlistenByKey(listener$$0.key), count++
        }
      }
    }
  }
  return count
};
goog.events.getListeners = function $goog$events$getListeners$(obj, type, capture) {
  return goog.events.getListeners_(obj, type, capture) || []
};
goog.events.getListeners_ = function $goog$events$getListeners_$(obj, type, capture) {
  var map = goog.events.listenerTree_;
  if(type in map && (map = map[type], capture in map)) {
    var map = map[capture], objUid = goog.getUid(obj);
    if(map[objUid]) {
      return map[objUid]
    }
  }
  return null
};
goog.events.getListener = function $goog$events$getListener$(src, type, listener, opt_capt, opt_handler) {
  var capture = !!opt_capt, listenerArray = goog.events.getListeners_(src, type, capture);
  if(listenerArray) {
    for(var i = 0;i < listenerArray.length;i++) {
      if(!listenerArray[i].removed && listenerArray[i].listener == listener && listenerArray[i].capture == capture && listenerArray[i].handler == opt_handler) {
        return listenerArray[i]
      }
    }
  }
  return null
};
goog.events.hasListener = function $goog$events$hasListener$(obj, opt_type, opt_capture) {
  var objUid = goog.getUid(obj), listeners = goog.events.sources_[objUid];
  if(listeners) {
    var hasType = goog.isDef(opt_type), hasCapture = goog.isDef(opt_capture);
    if(hasType && hasCapture) {
      var map = goog.events.listenerTree_[opt_type];
      return!!map && !!map[opt_capture] && objUid in map[opt_capture]
    }
    return!hasType && !hasCapture ? !0 : goog.array.some(listeners, function(listener) {
      return hasType && listener.type == opt_type || hasCapture && listener.capture == opt_capture
    })
  }
  return!1
};
goog.events.expose = function $goog$events$expose$(e) {
  var str = [], key;
  for(key in e) {
    e[key] && e[key].id ? str.push(key + " = " + e[key] + " (" + e[key].id + ")") : str.push(key + " = " + e[key])
  }
  return str.join("\n")
};
goog.events.getOnString_ = function $goog$events$getOnString_$(type) {
  return type in goog.events.onStringMap_ ? goog.events.onStringMap_[type] : goog.events.onStringMap_[type] = goog.events.onString_ + type
};
goog.events.fireListeners = function $goog$events$fireListeners$(obj, type, capture, eventObject) {
  var map = goog.events.listenerTree_;
  return type in map && (map = map[type], capture in map) ? goog.events.fireListeners_(map[capture], obj, type, capture, eventObject) : !0
};
goog.events.fireListeners_ = function $goog$events$fireListeners_$(map, obj, type, capture, eventObject) {
  var retval = 1, objUid = goog.getUid(obj);
  if(map[objUid]) {
    map.remaining_--;
    var listenerArray = map[objUid];
    listenerArray.locked_ ? listenerArray.locked_++ : listenerArray.locked_ = 1;
    try {
      for(var length = listenerArray.length, i = 0;i < length;i++) {
        var listener = listenerArray[i];
        listener && !listener.removed && (retval &= !1 !== goog.events.fireListener(listener, eventObject))
      }
    }finally {
      listenerArray.locked_--, goog.events.cleanUp_(type, capture, objUid, listenerArray)
    }
  }
  return Boolean(retval)
};
goog.events.fireListener = function $goog$events$fireListener$(listener, eventObject) {
  var rv = listener.handleEvent(eventObject);
  listener.callOnce && goog.events.unlistenByKey(listener.key);
  return rv
};
goog.events.getTotalListenerCount = function $goog$events$getTotalListenerCount$() {
  return goog.object.getCount(goog.events.listeners_)
};
goog.events.dispatchEvent = function $goog$events$dispatchEvent$(src, e) {
  var type = e.type || e, map = goog.events.listenerTree_;
  if(!(type in map)) {
    return!0
  }
  if(goog.isString(e)) {
    e = new goog.events.Event(e, src)
  }else {
    if(e instanceof goog.events.Event) {
      e.target = e.target || src
    }else {
      var oldEvent = e, e = new goog.events.Event(type, src);
      goog.object.extend(e, oldEvent)
    }
  }
  var rv = 1, ancestors, map = map[type], hasCapture = !0 in map, targetsMap;
  if(hasCapture) {
    ancestors = [];
    for(var parent = src;parent;parent = parent.getParentEventTarget()) {
      ancestors.push(parent)
    }
    targetsMap = map[!0];
    targetsMap.remaining_ = targetsMap.count_;
    for(var i = ancestors.length - 1;!e.propagationStopped_ && 0 <= i && targetsMap.remaining_;i--) {
      e.currentTarget = ancestors[i], rv &= goog.events.fireListeners_(targetsMap, ancestors[i], e.type, !0, e) && !1 != e.returnValue_
    }
  }
  var hasBubble = !1 in map;
  if(hasBubble) {
    if(targetsMap = map[!1], targetsMap.remaining_ = targetsMap.count_, hasCapture) {
      for(i = 0;!e.propagationStopped_ && i < ancestors.length && targetsMap.remaining_;i++) {
        e.currentTarget = ancestors[i], rv &= goog.events.fireListeners_(targetsMap, ancestors[i], e.type, !1, e) && !1 != e.returnValue_
      }
    }else {
      for(var current = src;!e.propagationStopped_ && current && targetsMap.remaining_;current = current.getParentEventTarget()) {
        e.currentTarget = current, rv &= goog.events.fireListeners_(targetsMap, current, e.type, !1, e) && !1 != e.returnValue_
      }
    }
  }
  return Boolean(rv)
};
goog.events.protectBrowserEventEntryPoint = function $goog$events$protectBrowserEventEntryPoint$(errorHandler) {
  goog.events.handleBrowserEvent_ = errorHandler.protectEntryPoint(goog.events.handleBrowserEvent_)
};
goog.events.handleBrowserEvent_ = function $goog$events$handleBrowserEvent_$(key, opt_evt) {
  if(!goog.events.listeners_[key]) {
    return!0
  }
  var listener = goog.events.listeners_[key], type = listener.type, map = goog.events.listenerTree_;
  if(!(type in map)) {
    return!0
  }
  var map = map[type], retval, targetsMap;
  if(!goog.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT) {
    var ieEvent = opt_evt || goog.getObjectByName("window.event"), hasCapture = !0 in map, hasBubble = !1 in map;
    if(hasCapture) {
      if(goog.events.isMarkedIeEvent_(ieEvent)) {
        return!0
      }
      goog.events.markIeEvent_(ieEvent)
    }
    var evt = new goog.events.BrowserEvent;
    evt.init(ieEvent, this);
    retval = !0;
    try {
      if(hasCapture) {
        for(var ancestors = [], parent = evt.currentTarget;parent;parent = parent.parentNode) {
          ancestors.push(parent)
        }
        targetsMap = map[!0];
        targetsMap.remaining_ = targetsMap.count_;
        for(var i = ancestors.length - 1;!evt.propagationStopped_ && 0 <= i && targetsMap.remaining_;i--) {
          evt.currentTarget = ancestors[i], retval &= goog.events.fireListeners_(targetsMap, ancestors[i], type, !0, evt)
        }
        if(hasBubble) {
          targetsMap = map[!1];
          targetsMap.remaining_ = targetsMap.count_;
          for(i = 0;!evt.propagationStopped_ && i < ancestors.length && targetsMap.remaining_;i++) {
            evt.currentTarget = ancestors[i], retval &= goog.events.fireListeners_(targetsMap, ancestors[i], type, !1, evt)
          }
        }
      }else {
        retval = goog.events.fireListener(listener, evt)
      }
    }finally {
      ancestors && (ancestors.length = 0), evt.dispose()
    }
    return retval
  }
  var be = new goog.events.BrowserEvent(opt_evt, this);
  try {
    retval = goog.events.fireListener(listener, be)
  }finally {
    be.dispose()
  }
  return retval
};
goog.events.markIeEvent_ = function $goog$events$markIeEvent_$(e) {
  var useReturnValue = !1;
  if(0 == e.keyCode) {
    try {
      e.keyCode = -1;
      return
    }catch(ex) {
      useReturnValue = !0
    }
  }
  if(useReturnValue || void 0 == e.returnValue) {
    e.returnValue = !0
  }
};
goog.events.isMarkedIeEvent_ = function $goog$events$isMarkedIeEvent_$(e) {
  return 0 > e.keyCode || void 0 != e.returnValue
};
goog.events.uniqueIdCounter_ = 0;
goog.events.getUniqueId = function $goog$events$getUniqueId$(identifier) {
  return identifier + "_" + goog.events.uniqueIdCounter_++
};
goog.debug.entryPointRegistry.register(function(transformer) {
  goog.events.handleBrowserEvent_ = transformer(goog.events.handleBrowserEvent_)
});
goog.events.EventTarget = function $goog$events$EventTarget$() {
  goog.Disposable.call(this)
};
goog.inherits(goog.events.EventTarget, goog.Disposable);
goog.events.EventTarget.prototype.customEvent_ = !0;
goog.events.EventTarget.prototype.parentEventTarget_ = null;
goog.events.EventTarget.prototype.getParentEventTarget = function $goog$events$EventTarget$$getParentEventTarget$() {
  return this.parentEventTarget_
};
goog.events.EventTarget.prototype.setParentEventTarget = function $goog$events$EventTarget$$setParentEventTarget$(parent) {
  this.parentEventTarget_ = parent
};
goog.events.EventTarget.prototype.addEventListener = function $goog$events$EventTarget$$addEventListener$(type, handler, opt_capture, opt_handlerScope) {
  goog.events.listen(this, type, handler, opt_capture, opt_handlerScope)
};
goog.events.EventTarget.prototype.removeEventListener = function $goog$events$EventTarget$$removeEventListener$(type, handler, opt_capture, opt_handlerScope) {
  goog.events.unlisten(this, type, handler, opt_capture, opt_handlerScope)
};
goog.events.EventTarget.prototype.dispatchEvent = function $goog$events$EventTarget$$dispatchEvent$(e) {
  return goog.events.dispatchEvent(this, e)
};
goog.events.EventTarget.prototype.disposeInternal = function $goog$events$EventTarget$$disposeInternal$() {
  goog.events.EventTarget.superClass_.disposeInternal.call(this);
  goog.events.removeAll(this);
  this.parentEventTarget_ = null
};
goog.events.KeyCodes = {WIN_KEY_FF_LINUX:0, MAC_ENTER:3, BACKSPACE:8, TAB:9, NUM_CENTER:12, ENTER:13, SHIFT:16, CTRL:17, ALT:18, PAUSE:19, CAPS_LOCK:20, ESC:27, SPACE:32, PAGE_UP:33, PAGE_DOWN:34, END:35, HOME:36, LEFT:37, UP:38, RIGHT:39, DOWN:40, PRINT_SCREEN:44, INSERT:45, DELETE:46, ZERO:48, ONE:49, TWO:50, THREE:51, FOUR:52, FIVE:53, SIX:54, SEVEN:55, EIGHT:56, NINE:57, FF_SEMICOLON:59, FF_EQUALS:61, QUESTION_MARK:63, A:65, B:66, C:67, D:68, E:69, F:70, G:71, H:72, I:73, J:74, K:75, L:76, M:77, 
N:78, O:79, P:80, Q:81, R:82, S:83, T:84, U:85, V:86, W:87, X:88, Y:89, Z:90, META:91, WIN_KEY_RIGHT:92, CONTEXT_MENU:93, NUM_ZERO:96, NUM_ONE:97, NUM_TWO:98, NUM_THREE:99, NUM_FOUR:100, NUM_FIVE:101, NUM_SIX:102, NUM_SEVEN:103, NUM_EIGHT:104, NUM_NINE:105, NUM_MULTIPLY:106, NUM_PLUS:107, NUM_MINUS:109, NUM_PERIOD:110, NUM_DIVISION:111, F1:112, F2:113, F3:114, F4:115, F5:116, F6:117, F7:118, F8:119, F9:120, F10:121, F11:122, F12:123, NUMLOCK:144, SCROLL_LOCK:145, FIRST_MEDIA_KEY:166, LAST_MEDIA_KEY:183, 
SEMICOLON:186, DASH:189, EQUALS:187, COMMA:188, PERIOD:190, SLASH:191, APOSTROPHE:192, TILDE:192, SINGLE_QUOTE:222, OPEN_SQUARE_BRACKET:219, BACKSLASH:220, CLOSE_SQUARE_BRACKET:221, WIN_KEY:224, MAC_FF_META:224, WIN_IME:229, PHANTOM:255};
goog.events.KeyCodes.isTextModifyingKeyEvent = function $goog$events$KeyCodes$isTextModifyingKeyEvent$(e) {
  if(e.altKey && !e.ctrlKey || e.metaKey || e.keyCode >= goog.events.KeyCodes.F1 && e.keyCode <= goog.events.KeyCodes.F12) {
    return!1
  }
  switch(e.keyCode) {
    case goog.events.KeyCodes.ALT:
    ;
    case goog.events.KeyCodes.CAPS_LOCK:
    ;
    case goog.events.KeyCodes.CONTEXT_MENU:
    ;
    case goog.events.KeyCodes.CTRL:
    ;
    case goog.events.KeyCodes.DOWN:
    ;
    case goog.events.KeyCodes.END:
    ;
    case goog.events.KeyCodes.ESC:
    ;
    case goog.events.KeyCodes.HOME:
    ;
    case goog.events.KeyCodes.INSERT:
    ;
    case goog.events.KeyCodes.LEFT:
    ;
    case goog.events.KeyCodes.MAC_FF_META:
    ;
    case goog.events.KeyCodes.META:
    ;
    case goog.events.KeyCodes.NUMLOCK:
    ;
    case goog.events.KeyCodes.NUM_CENTER:
    ;
    case goog.events.KeyCodes.PAGE_DOWN:
    ;
    case goog.events.KeyCodes.PAGE_UP:
    ;
    case goog.events.KeyCodes.PAUSE:
    ;
    case goog.events.KeyCodes.PHANTOM:
    ;
    case goog.events.KeyCodes.PRINT_SCREEN:
    ;
    case goog.events.KeyCodes.RIGHT:
    ;
    case goog.events.KeyCodes.SCROLL_LOCK:
    ;
    case goog.events.KeyCodes.SHIFT:
    ;
    case goog.events.KeyCodes.UP:
    ;
    case goog.events.KeyCodes.WIN_KEY:
    ;
    case goog.events.KeyCodes.WIN_KEY_RIGHT:
      return!1;
    case goog.events.KeyCodes.WIN_KEY_FF_LINUX:
      return!goog.userAgent.GECKO;
    default:
      return e.keyCode < goog.events.KeyCodes.FIRST_MEDIA_KEY || e.keyCode > goog.events.KeyCodes.LAST_MEDIA_KEY
  }
};
goog.events.KeyCodes.firesKeyPressEvent = function $goog$events$KeyCodes$firesKeyPressEvent$(keyCode, opt_heldKeyCode, opt_shiftKey, opt_ctrlKey, opt_altKey) {
  if(!goog.userAgent.IE && (!goog.userAgent.WEBKIT || !goog.userAgent.isVersion("525"))) {
    return!0
  }
  if(goog.userAgent.MAC && opt_altKey) {
    return goog.events.KeyCodes.isCharacterKey(keyCode)
  }
  if(opt_altKey && !opt_ctrlKey || !opt_shiftKey && (opt_heldKeyCode == goog.events.KeyCodes.CTRL || opt_heldKeyCode == goog.events.KeyCodes.ALT) || goog.userAgent.IE && opt_ctrlKey && opt_heldKeyCode == keyCode) {
    return!1
  }
  switch(keyCode) {
    case goog.events.KeyCodes.ENTER:
      return!(goog.userAgent.IE && goog.userAgent.isDocumentMode(9));
    case goog.events.KeyCodes.ESC:
      return!goog.userAgent.WEBKIT
  }
  return goog.events.KeyCodes.isCharacterKey(keyCode)
};
goog.events.KeyCodes.isCharacterKey = function $goog$events$KeyCodes$isCharacterKey$(keyCode) {
  if(keyCode >= goog.events.KeyCodes.ZERO && keyCode <= goog.events.KeyCodes.NINE || keyCode >= goog.events.KeyCodes.NUM_ZERO && keyCode <= goog.events.KeyCodes.NUM_MULTIPLY || keyCode >= goog.events.KeyCodes.A && keyCode <= goog.events.KeyCodes.Z || goog.userAgent.WEBKIT && 0 == keyCode) {
    return!0
  }
  switch(keyCode) {
    case goog.events.KeyCodes.SPACE:
    ;
    case goog.events.KeyCodes.QUESTION_MARK:
    ;
    case goog.events.KeyCodes.NUM_PLUS:
    ;
    case goog.events.KeyCodes.NUM_MINUS:
    ;
    case goog.events.KeyCodes.NUM_PERIOD:
    ;
    case goog.events.KeyCodes.NUM_DIVISION:
    ;
    case goog.events.KeyCodes.SEMICOLON:
    ;
    case goog.events.KeyCodes.FF_SEMICOLON:
    ;
    case goog.events.KeyCodes.DASH:
    ;
    case goog.events.KeyCodes.EQUALS:
    ;
    case goog.events.KeyCodes.FF_EQUALS:
    ;
    case goog.events.KeyCodes.COMMA:
    ;
    case goog.events.KeyCodes.PERIOD:
    ;
    case goog.events.KeyCodes.SLASH:
    ;
    case goog.events.KeyCodes.APOSTROPHE:
    ;
    case goog.events.KeyCodes.SINGLE_QUOTE:
    ;
    case goog.events.KeyCodes.OPEN_SQUARE_BRACKET:
    ;
    case goog.events.KeyCodes.BACKSLASH:
    ;
    case goog.events.KeyCodes.CLOSE_SQUARE_BRACKET:
      return!0;
    default:
      return!1
  }
};
goog.events.KeyCodes.normalizeGeckoKeyCode = function $goog$events$KeyCodes$normalizeGeckoKeyCode$(keyCode) {
  switch(keyCode) {
    case goog.events.KeyCodes.FF_EQUALS:
      return goog.events.KeyCodes.EQUALS;
    case goog.events.KeyCodes.FF_SEMICOLON:
      return goog.events.KeyCodes.SEMICOLON;
    case goog.events.KeyCodes.MAC_FF_META:
      return goog.events.KeyCodes.META;
    case goog.events.KeyCodes.WIN_KEY_FF_LINUX:
      return goog.events.KeyCodes.WIN_KEY;
    default:
      return keyCode
  }
};
goog.math.Box = function $goog$math$Box$(top, right, bottom, left) {
  this.top = top;
  this.right = right;
  this.bottom = bottom;
  this.left = left
};
goog.math.Box.boundingBox = function $goog$math$Box$boundingBox$(var_args) {
  for(var box = new goog.math.Box(arguments[0].y, arguments[0].x, arguments[0].y, arguments[0].x), i = 1;i < arguments.length;i++) {
    var coord = arguments[i];
    box.top = Math.min(box.top, coord.y);
    box.right = Math.max(box.right, coord.x);
    box.bottom = Math.max(box.bottom, coord.y);
    box.left = Math.min(box.left, coord.x)
  }
  return box
};
goog.math.Box.prototype.clone = function $goog$math$Box$$clone$() {
  return new goog.math.Box(this.top, this.right, this.bottom, this.left)
};
goog.DEBUG && (goog.math.Box.prototype.toString = function $goog$math$Box$$toString$() {
  return"(" + this.top + "t, " + this.right + "r, " + this.bottom + "b, " + this.left + "l)"
});
goog.math.Box.prototype.contains = function $goog$math$Box$$contains$(other) {
  return goog.math.Box.contains(this, other)
};
goog.math.Box.prototype.expand = function $goog$math$Box$$expand$(top, opt_right, opt_bottom, opt_left) {
  if(goog.isObject(top)) {
    this.top = this.top - top.top;
    this.right = this.right + top.right;
    this.bottom = this.bottom + top.bottom;
    this.left = this.left - top.left
  }else {
    this.top = this.top - top;
    this.right = this.right + opt_right;
    this.bottom = this.bottom + opt_bottom;
    this.left = this.left - opt_left
  }
  return this
};
goog.math.Box.equals = function $goog$math$Box$equals$(a, b) {
  return a == b ? true : !a || !b ? false : a.top == b.top && a.right == b.right && a.bottom == b.bottom && a.left == b.left
};
goog.math.Box.contains = function $goog$math$Box$contains$(box, other) {
  return!box || !other ? false : other instanceof goog.math.Box ? other.left >= box.left && other.right <= box.right && other.top >= box.top && other.bottom <= box.bottom : other.x >= box.left && other.x <= box.right && other.y >= box.top && other.y <= box.bottom
};
goog.math.Box.distance = function $goog$math$Box$distance$(box, coord) {
  return coord.x >= box.left && coord.x <= box.right ? coord.y >= box.top && coord.y <= box.bottom ? 0 : coord.y < box.top ? box.top - coord.y : coord.y - box.bottom : coord.y >= box.top && coord.y <= box.bottom ? coord.x < box.left ? box.left - coord.x : coord.x - box.right : goog.math.Coordinate.distance(coord, new goog.math.Coordinate(coord.x < box.left ? box.left : box.right, coord.y < box.top ? box.top : box.bottom))
};
goog.math.Box.intersects = function $goog$math$Box$intersects$(a, b) {
  return a.left <= b.right && b.left <= a.right && a.top <= b.bottom && b.top <= a.bottom
};
goog.math.Box.intersectsWithPadding = function $goog$math$Box$intersectsWithPadding$(a, b, padding) {
  return a.left <= b.right + padding && b.left <= a.right + padding && a.top <= b.bottom + padding && b.top <= a.bottom + padding
};
goog.math.Rect = function $goog$math$Rect$(x, y, w, h) {
  this.left = x;
  this.top = y;
  this.width = w;
  this.height = h
};
goog.math.Rect.prototype.clone = function $goog$math$Rect$$clone$() {
  return new goog.math.Rect(this.left, this.top, this.width, this.height)
};
goog.math.Rect.createFromBox = function $goog$math$Rect$createFromBox$(box) {
  return new goog.math.Rect(box.left, box.top, box.right - box.left, box.bottom - box.top)
};
goog.DEBUG && (goog.math.Rect.prototype.toString = function $goog$math$Rect$$toString$() {
  return"(" + this.left + ", " + this.top + " - " + this.width + "w x " + this.height + "h)"
});
goog.math.Rect.equals = function $goog$math$Rect$equals$(a, b) {
  return a == b ? true : !a || !b ? false : a.left == b.left && a.width == b.width && a.top == b.top && a.height == b.height
};
goog.math.Rect.prototype.intersection = function $goog$math$Rect$$intersection$(rect) {
  var x0 = Math.max(this.left, rect.left), x1 = Math.min(this.left + this.width, rect.left + rect.width);
  if(x0 <= x1) {
    var y0 = Math.max(this.top, rect.top), y1 = Math.min(this.top + this.height, rect.top + rect.height);
    if(y0 <= y1) {
      this.left = x0;
      this.top = y0;
      this.width = x1 - x0;
      this.height = y1 - y0;
      return true
    }
  }
  return false
};
goog.math.Rect.intersection = function $goog$math$Rect$intersection$(a, b) {
  var x0 = Math.max(a.left, b.left), x1 = Math.min(a.left + a.width, b.left + b.width);
  if(x0 <= x1) {
    var y0 = Math.max(a.top, b.top), y1 = Math.min(a.top + a.height, b.top + b.height);
    if(y0 <= y1) {
      return new goog.math.Rect(x0, y0, x1 - x0, y1 - y0)
    }
  }
  return null
};
goog.math.Rect.intersects = function $goog$math$Rect$intersects$(a, b) {
  return a.left <= b.left + b.width && b.left <= a.left + a.width && a.top <= b.top + b.height && b.top <= a.top + a.height
};
goog.math.Rect.prototype.intersects = function $goog$math$Rect$$intersects$(rect) {
  return goog.math.Rect.intersects(this, rect)
};
goog.math.Rect.difference = function $goog$math$Rect$difference$(a, b) {
  var intersection = goog.math.Rect.intersection(a, b);
  if(!intersection || !intersection.height || !intersection.width) {
    return[a.clone()]
  }
  var result = [], top = a.top, height = a.height, ar = a.left + a.width, ab = a.top + a.height, br = b.left + b.width, bb = b.top + b.height;
  if(b.top > a.top) {
    result.push(new goog.math.Rect(a.left, a.top, a.width, b.top - a.top));
    top = b.top;
    height = height - (b.top - a.top)
  }
  if(bb < ab) {
    result.push(new goog.math.Rect(a.left, bb, a.width, ab - bb));
    height = bb - top
  }
  b.left > a.left && result.push(new goog.math.Rect(a.left, top, b.left - a.left, height));
  br < ar && result.push(new goog.math.Rect(br, top, ar - br, height));
  return result
};
goog.math.Rect.prototype.difference = function $goog$math$Rect$$difference$(rect) {
  return goog.math.Rect.difference(this, rect)
};
goog.math.Rect.prototype.boundingRect = function $goog$math$Rect$$boundingRect$(rect) {
  var right = Math.max(this.left + this.width, rect.left + rect.width), bottom = Math.max(this.top + this.height, rect.top + rect.height);
  this.left = Math.min(this.left, rect.left);
  this.top = Math.min(this.top, rect.top);
  this.width = right - this.left;
  this.height = bottom - this.top
};
goog.math.Rect.boundingRect = function $goog$math$Rect$boundingRect$(a, b) {
  if(!a || !b) {
    return null
  }
  var clone = a.clone();
  clone.boundingRect(b);
  return clone
};
goog.math.Rect.prototype.contains = function $goog$math$Rect$$contains$(another) {
  return another instanceof goog.math.Rect ? this.left <= another.left && this.left + this.width >= another.left + another.width && this.top <= another.top && this.top + this.height >= another.top + another.height : another.x >= this.left && another.x <= this.left + this.width && another.y >= this.top && another.y <= this.top + this.height
};
goog.math.Rect.prototype.getSize = function $goog$math$Rect$$getSize$() {
  return new goog.math.Size(this.width, this.height)
};
goog.style = {};
goog.style.setStyle = function $goog$style$setStyle$(element, style, opt_value) {
  goog.isString(style) ? goog.style.setStyle_(element, opt_value, style) : goog.object.forEach(style, goog.partial(goog.style.setStyle_, element))
};
goog.style.setStyle_ = function $goog$style$setStyle_$(element, value, style) {
  element.style[goog.string.toCamelCase(style)] = value
};
goog.style.getStyle = function $goog$style$getStyle$(element, property) {
  return element.style[goog.string.toCamelCase(property)] || ""
};
goog.style.getComputedStyle = function $goog$style$getComputedStyle$(element, property) {
  var doc = goog.dom.getOwnerDocument(element);
  if(doc.defaultView && doc.defaultView.getComputedStyle) {
    var styles = doc.defaultView.getComputedStyle(element, null);
    if(styles) {
      return styles[property] || styles.getPropertyValue(property)
    }
  }
  return""
};
goog.style.getCascadedStyle = function $goog$style$getCascadedStyle$(element, style) {
  return element.currentStyle ? element.currentStyle[style] : null
};
goog.style.getStyle_ = function $goog$style$getStyle_$(element, style) {
  return goog.style.getComputedStyle(element, style) || goog.style.getCascadedStyle(element, style) || element.style && element.style[style]
};
goog.style.getComputedPosition = function $goog$style$getComputedPosition$(element) {
  return goog.style.getStyle_(element, "position")
};
goog.style.getBackgroundColor = function $goog$style$getBackgroundColor$(element) {
  return goog.style.getStyle_(element, "backgroundColor")
};
goog.style.getComputedOverflowX = function $goog$style$getComputedOverflowX$(element) {
  return goog.style.getStyle_(element, "overflowX")
};
goog.style.getComputedOverflowY = function $goog$style$getComputedOverflowY$(element) {
  return goog.style.getStyle_(element, "overflowY")
};
goog.style.getComputedZIndex = function $goog$style$getComputedZIndex$(element) {
  return goog.style.getStyle_(element, "zIndex")
};
goog.style.getComputedTextAlign = function $goog$style$getComputedTextAlign$(element) {
  return goog.style.getStyle_(element, "textAlign")
};
goog.style.getComputedCursor = function $goog$style$getComputedCursor$(element) {
  return goog.style.getStyle_(element, "cursor")
};
goog.style.setPosition = function $goog$style$setPosition$(el, arg1, opt_arg2) {
  var x, y, buggyGeckoSubPixelPos = goog.userAgent.GECKO && (goog.userAgent.MAC || goog.userAgent.X11) && goog.userAgent.isVersion("1.9");
  arg1 instanceof goog.math.Coordinate ? (x = arg1.x, y = arg1.y) : (x = arg1, y = opt_arg2);
  el.style.left = goog.style.getPixelStyleValue_(x, buggyGeckoSubPixelPos);
  el.style.top = goog.style.getPixelStyleValue_(y, buggyGeckoSubPixelPos)
};
goog.style.getPosition = function $goog$style$getPosition$(element) {
  return new goog.math.Coordinate(element.offsetLeft, element.offsetTop)
};
goog.style.getClientViewportElement = function $goog$style$getClientViewportElement$(opt_node) {
  var doc;
  doc = opt_node ? opt_node.nodeType == goog.dom.NodeType.DOCUMENT ? opt_node : goog.dom.getOwnerDocument(opt_node) : goog.dom.getDocument();
  return goog.userAgent.IE && !goog.userAgent.isDocumentMode(9) && !goog.dom.getDomHelper(doc).isCss1CompatMode() ? doc.body : doc.documentElement
};
goog.style.getBoundingClientRect_ = function $goog$style$getBoundingClientRect_$(el) {
  var rect = el.getBoundingClientRect();
  if(goog.userAgent.IE) {
    var doc = el.ownerDocument;
    rect.left -= doc.documentElement.clientLeft + doc.body.clientLeft;
    rect.top -= doc.documentElement.clientTop + doc.body.clientTop
  }
  return rect
};
goog.style.getOffsetParent = function $goog$style$getOffsetParent$(element) {
  if(goog.userAgent.IE && !goog.userAgent.isDocumentMode(8)) {
    return element.offsetParent
  }
  for(var doc = goog.dom.getOwnerDocument(element), positionStyle = goog.style.getStyle_(element, "position"), skipStatic = "fixed" == positionStyle || "absolute" == positionStyle, parent = element.parentNode;parent && parent != doc;parent = parent.parentNode) {
    if(positionStyle = goog.style.getStyle_(parent, "position"), skipStatic = skipStatic && "static" == positionStyle && parent != doc.documentElement && parent != doc.body, !skipStatic && (parent.scrollWidth > parent.clientWidth || parent.scrollHeight > parent.clientHeight || "fixed" == positionStyle || "absolute" == positionStyle || "relative" == positionStyle)) {
      return parent
    }
  }
  return null
};
goog.style.getVisibleRectForElement = function $goog$style$getVisibleRectForElement$(element) {
  for(var visibleRect = new goog.math.Box(0, Infinity, Infinity, 0), dom = goog.dom.getDomHelper(element), body = dom.getDocument().body, documentElement = dom.getDocument().documentElement, scrollEl = dom.getDocumentScrollElement(), el = element;el = goog.style.getOffsetParent(el);) {
    if((!goog.userAgent.IE || 0 != el.clientWidth) && (!goog.userAgent.WEBKIT || 0 != el.clientHeight || el != body) && el != body && el != documentElement && "visible" != goog.style.getStyle_(el, "overflow")) {
      var pos = goog.style.getPageOffset(el), client = goog.style.getClientLeftTop(el);
      pos.x += client.x;
      pos.y += client.y;
      visibleRect.top = Math.max(visibleRect.top, pos.y);
      visibleRect.right = Math.min(visibleRect.right, pos.x + el.clientWidth);
      visibleRect.bottom = Math.min(visibleRect.bottom, pos.y + el.clientHeight);
      visibleRect.left = Math.max(visibleRect.left, pos.x)
    }
  }
  var scrollX = scrollEl.scrollLeft, scrollY = scrollEl.scrollTop;
  visibleRect.left = Math.max(visibleRect.left, scrollX);
  visibleRect.top = Math.max(visibleRect.top, scrollY);
  var winSize = dom.getViewportSize();
  visibleRect.right = Math.min(visibleRect.right, scrollX + winSize.width);
  visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + winSize.height);
  return 0 <= visibleRect.top && 0 <= visibleRect.left && visibleRect.bottom > visibleRect.top && visibleRect.right > visibleRect.left ? visibleRect : null
};
goog.style.getContainerOffsetToScrollInto = function $goog$style$getContainerOffsetToScrollInto$(element, container, opt_center) {
  var elementPos = goog.style.getPageOffset(element), containerPos = goog.style.getPageOffset(container), containerBorder = goog.style.getBorderBox(container), relX = elementPos.x - containerPos.x - containerBorder.left, relY = elementPos.y - containerPos.y - containerBorder.top, spaceX = container.clientWidth - element.offsetWidth, spaceY = container.clientHeight - element.offsetHeight, scrollLeft = container.scrollLeft, scrollTop = container.scrollTop;
  opt_center ? (scrollLeft += relX - spaceX / 2, scrollTop += relY - spaceY / 2) : (scrollLeft += Math.min(relX, Math.max(relX - spaceX, 0)), scrollTop += Math.min(relY, Math.max(relY - spaceY, 0)));
  return new goog.math.Coordinate(scrollLeft, scrollTop)
};
goog.style.scrollIntoContainerView = function $goog$style$scrollIntoContainerView$(element, container, opt_center) {
  var offset = goog.style.getContainerOffsetToScrollInto(element, container, opt_center);
  container.scrollLeft = offset.x;
  container.scrollTop = offset.y
};
goog.style.getClientLeftTop = function $goog$style$getClientLeftTop$(el) {
  if(goog.userAgent.GECKO && !goog.userAgent.isVersion("1.9")) {
    var left = parseFloat(goog.style.getComputedStyle(el, "borderLeftWidth"));
    if(goog.style.isRightToLeft(el)) {
      var scrollbarWidth = el.offsetWidth - el.clientWidth - left - parseFloat(goog.style.getComputedStyle(el, "borderRightWidth")), left = left + scrollbarWidth
    }
    return new goog.math.Coordinate(left, parseFloat(goog.style.getComputedStyle(el, "borderTopWidth")))
  }
  return new goog.math.Coordinate(el.clientLeft, el.clientTop)
};
goog.style.getPageOffset = function $goog$style$getPageOffset$(el) {
  var box, doc = goog.dom.getOwnerDocument(el), positionStyle = goog.style.getStyle_(el, "position"), BUGGY_GECKO_BOX_OBJECT = goog.userAgent.GECKO && doc.getBoxObjectFor && !el.getBoundingClientRect && "absolute" == positionStyle && (box = doc.getBoxObjectFor(el)) && (0 > box.screenX || 0 > box.screenY), pos = new goog.math.Coordinate(0, 0), viewportElement = goog.style.getClientViewportElement(doc);
  if(el == viewportElement) {
    return pos
  }
  if(el.getBoundingClientRect) {
    box = goog.style.getBoundingClientRect_(el);
    var scrollCoord = goog.dom.getDomHelper(doc).getDocumentScroll();
    pos.x = box.left + scrollCoord.x;
    pos.y = box.top + scrollCoord.y
  }else {
    if(doc.getBoxObjectFor && !BUGGY_GECKO_BOX_OBJECT) {
      box = doc.getBoxObjectFor(el);
      var vpBox = doc.getBoxObjectFor(viewportElement);
      pos.x = box.screenX - vpBox.screenX;
      pos.y = box.screenY - vpBox.screenY
    }else {
      var parent = el;
      do {
        pos.x += parent.offsetLeft;
        pos.y += parent.offsetTop;
        parent != el && (pos.x += parent.clientLeft || 0, pos.y += parent.clientTop || 0);
        if(goog.userAgent.WEBKIT && "fixed" == goog.style.getComputedPosition(parent)) {
          pos.x += doc.body.scrollLeft;
          pos.y += doc.body.scrollTop;
          break
        }
        parent = parent.offsetParent
      }while(parent && parent != el);
      if(goog.userAgent.OPERA || goog.userAgent.WEBKIT && "absolute" == positionStyle) {
        pos.y -= doc.body.offsetTop
      }
      for(parent = el;(parent = goog.style.getOffsetParent(parent)) && parent != doc.body && parent != viewportElement;) {
        if(pos.x -= parent.scrollLeft, !goog.userAgent.OPERA || "TR" != parent.tagName) {
          pos.y -= parent.scrollTop
        }
      }
    }
  }
  return pos
};
goog.style.getPageOffsetLeft = function $goog$style$getPageOffsetLeft$(el) {
  return goog.style.getPageOffset(el).x
};
goog.style.getPageOffsetTop = function $goog$style$getPageOffsetTop$(el) {
  return goog.style.getPageOffset(el).y
};
goog.style.getFramedPageOffset = function $goog$style$getFramedPageOffset$(el, relativeWin) {
  var position = new goog.math.Coordinate(0, 0), currentWin = goog.dom.getWindow(goog.dom.getOwnerDocument(el)), currentEl = el;
  do {
    var offset = currentWin == relativeWin ? goog.style.getPageOffset(currentEl) : goog.style.getClientPosition(currentEl);
    position.x += offset.x;
    position.y += offset.y
  }while(currentWin && currentWin != relativeWin && (currentEl = currentWin.frameElement) && (currentWin = currentWin.parent));
  return position
};
goog.style.translateRectForAnotherFrame = function $goog$style$translateRectForAnotherFrame$(rect, origBase, newBase) {
  if(origBase.getDocument() != newBase.getDocument()) {
    var body = origBase.getDocument().body, pos = goog.style.getFramedPageOffset(body, newBase.getWindow()), pos = goog.math.Coordinate.difference(pos, goog.style.getPageOffset(body));
    goog.userAgent.IE && !origBase.isCss1CompatMode() && (pos = goog.math.Coordinate.difference(pos, origBase.getDocumentScroll()));
    rect.left += pos.x;
    rect.top += pos.y
  }
};
goog.style.getRelativePosition = function $goog$style$getRelativePosition$(a, b) {
  var ap = goog.style.getClientPosition(a), bp = goog.style.getClientPosition(b);
  return new goog.math.Coordinate(ap.x - bp.x, ap.y - bp.y)
};
goog.style.getClientPosition = function $goog$style$getClientPosition$(el) {
  var pos = new goog.math.Coordinate;
  if(el.nodeType == goog.dom.NodeType.ELEMENT) {
    if(el.getBoundingClientRect) {
      var box = goog.style.getBoundingClientRect_(el);
      pos.x = box.left;
      pos.y = box.top
    }else {
      var scrollCoord = goog.dom.getDomHelper(el).getDocumentScroll(), pageCoord = goog.style.getPageOffset(el);
      pos.x = pageCoord.x - scrollCoord.x;
      pos.y = pageCoord.y - scrollCoord.y
    }
  }else {
    var isAbstractedEvent = goog.isFunction(el.getBrowserEvent), targetEvent = el;
    el.targetTouches ? targetEvent = el.targetTouches[0] : isAbstractedEvent && el.getBrowserEvent().targetTouches && (targetEvent = el.getBrowserEvent().targetTouches[0]);
    pos.x = targetEvent.clientX;
    pos.y = targetEvent.clientY
  }
  return pos
};
goog.style.setPageOffset = function $goog$style$setPageOffset$(el, x, opt_y) {
  var cur = goog.style.getPageOffset(el);
  x instanceof goog.math.Coordinate && (opt_y = x.y, x = x.x);
  var dx = x - cur.x, dy = opt_y - cur.y;
  goog.style.setPosition(el, el.offsetLeft + dx, el.offsetTop + dy)
};
goog.style.setSize = function $goog$style$setSize$(element, w, opt_h) {
  var h;
  if(w instanceof goog.math.Size) {
    h = w.height, w = w.width
  }else {
    if(void 0 == opt_h) {
      throw Error("missing height argument");
    }
    h = opt_h
  }
  goog.style.setWidth(element, w);
  goog.style.setHeight(element, h)
};
goog.style.getPixelStyleValue_ = function $goog$style$getPixelStyleValue_$(value, round) {
  "number" == typeof value && (value = (round ? Math.round(value) : value) + "px");
  return value
};
goog.style.setHeight = function $goog$style$setHeight$(element, height) {
  element.style.height = goog.style.getPixelStyleValue_(height, !0)
};
goog.style.setWidth = function $goog$style$setWidth$(element, width) {
  element.style.width = goog.style.getPixelStyleValue_(width, !0)
};
goog.style.getSize = function $goog$style$getSize$(element) {
  if("none" != goog.style.getStyle_(element, "display")) {
    return goog.style.getSizeWithDisplay_(element)
  }
  var style = element.style, originalDisplay = style.display, originalVisibility = style.visibility, originalPosition = style.position;
  style.visibility = "hidden";
  style.position = "absolute";
  style.display = "inline";
  var size = goog.style.getSizeWithDisplay_(element);
  style.display = originalDisplay;
  style.position = originalPosition;
  style.visibility = originalVisibility;
  return size
};
goog.style.getSizeWithDisplay_ = function $goog$style$getSizeWithDisplay_$(element) {
  var offsetWidth = element.offsetWidth, offsetHeight = element.offsetHeight, webkitOffsetsZero = goog.userAgent.WEBKIT && !offsetWidth && !offsetHeight;
  if((!goog.isDef(offsetWidth) || webkitOffsetsZero) && element.getBoundingClientRect) {
    var clientRect = goog.style.getBoundingClientRect_(element);
    return new goog.math.Size(clientRect.right - clientRect.left, clientRect.bottom - clientRect.top)
  }
  return new goog.math.Size(offsetWidth, offsetHeight)
};
goog.style.getBounds = function $goog$style$getBounds$(element) {
  var o = goog.style.getPageOffset(element), s = goog.style.getSize(element);
  return new goog.math.Rect(o.x, o.y, s.width, s.height)
};
goog.style.toCamelCase = function $goog$style$toCamelCase$(selector) {
  return goog.string.toCamelCase("" + selector)
};
goog.style.toSelectorCase = function $goog$style$toSelectorCase$(selector) {
  return goog.string.toSelectorCase(selector)
};
goog.style.getOpacity = function $goog$style$getOpacity$(el) {
  var style = el.style, result = "";
  if("opacity" in style) {
    result = style.opacity
  }else {
    if("MozOpacity" in style) {
      result = style.MozOpacity
    }else {
      if("filter" in style) {
        var match = style.filter.match(/alpha\(opacity=([\d.]+)\)/);
        match && (result = "" + match[1] / 100)
      }
    }
  }
  return"" == result ? result : Number(result)
};
goog.style.setOpacity = function $goog$style$setOpacity$(el, alpha) {
  var style = el.style;
  "opacity" in style ? style.opacity = alpha : "MozOpacity" in style ? style.MozOpacity = alpha : "filter" in style && (style.filter = "" === alpha ? "" : "alpha(opacity=" + 100 * alpha + ")")
};
goog.style.setTransparentBackgroundImage = function $goog$style$setTransparentBackgroundImage$(el, src) {
  var style = el.style;
  goog.userAgent.IE && !goog.userAgent.isVersion("8") ? style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + src + '", sizingMethod="crop")' : (style.backgroundImage = "url(" + src + ")", style.backgroundPosition = "top left", style.backgroundRepeat = "no-repeat")
};
goog.style.clearTransparentBackgroundImage = function $goog$style$clearTransparentBackgroundImage$(el) {
  var style = el.style;
  "filter" in style ? style.filter = "" : style.backgroundImage = "none"
};
goog.style.showElement = function $goog$style$showElement$(el, display) {
  el.style.display = display ? "" : "none"
};
goog.style.isElementShown = function $goog$style$isElementShown$(el) {
  return"none" != el.style.display
};
goog.style.installStyles = function $goog$style$installStyles$(stylesString, opt_node) {
  var dh = goog.dom.getDomHelper(opt_node), styleSheet = null;
  if(goog.userAgent.IE) {
    styleSheet = dh.getDocument().createStyleSheet(), goog.style.setStyles(styleSheet, stylesString)
  }else {
    var head = dh.getElementsByTagNameAndClass("head")[0];
    if(!head) {
      var body = dh.getElementsByTagNameAndClass("body")[0], head = dh.createDom("head");
      body.parentNode.insertBefore(head, body)
    }
    styleSheet = dh.createDom("style");
    goog.style.setStyles(styleSheet, stylesString);
    dh.appendChild(head, styleSheet)
  }
  return styleSheet
};
goog.style.uninstallStyles = function $goog$style$uninstallStyles$(styleSheet) {
  var node = styleSheet.ownerNode || styleSheet.owningElement || styleSheet;
  goog.dom.removeNode(node)
};
goog.style.setStyles = function $goog$style$setStyles$(element, stylesString) {
  if(goog.userAgent.IE) {
    element.cssText = stylesString
  }else {
    var propToSet = goog.userAgent.WEBKIT ? "innerText" : "innerHTML";
    element[propToSet] = stylesString
  }
};
goog.style.setPreWrap = function $goog$style$setPreWrap$(el) {
  var style = el.style;
  goog.userAgent.IE && !goog.userAgent.isVersion("8") ? (style.whiteSpace = "pre", style.wordWrap = "break-word") : style.whiteSpace = goog.userAgent.GECKO ? "-moz-pre-wrap" : "pre-wrap"
};
goog.style.setInlineBlock = function $goog$style$setInlineBlock$(el) {
  var style = el.style;
  style.position = "relative";
  goog.userAgent.IE && !goog.userAgent.isVersion("8") ? (style.zoom = "1", style.display = "inline") : style.display = goog.userAgent.GECKO ? goog.userAgent.isVersion("1.9a") ? "inline-block" : "-moz-inline-box" : "inline-block"
};
goog.style.isRightToLeft = function $goog$style$isRightToLeft$(el) {
  return"rtl" == goog.style.getStyle_(el, "direction")
};
goog.style.unselectableStyle_ = goog.userAgent.GECKO ? "MozUserSelect" : goog.userAgent.WEBKIT ? "WebkitUserSelect" : null;
goog.style.isUnselectable = function $goog$style$isUnselectable$(el) {
  return goog.style.unselectableStyle_ ? "none" == el.style[goog.style.unselectableStyle_].toLowerCase() : goog.userAgent.IE || goog.userAgent.OPERA ? "on" == el.getAttribute("unselectable") : !1
};
goog.style.setUnselectable = function $goog$style$setUnselectable$(el, unselectable, opt_noRecurse) {
  var descendants = !opt_noRecurse ? el.getElementsByTagName("*") : null, name = goog.style.unselectableStyle_;
  if(name) {
    var value = unselectable ? "none" : "";
    el.style[name] = value;
    if(descendants) {
      for(var i = 0, descendant;descendant = descendants[i];i++) {
        descendant.style[name] = value
      }
    }
  }else {
    if(goog.userAgent.IE || goog.userAgent.OPERA) {
      if(value = unselectable ? "on" : "", el.setAttribute("unselectable", value), descendants) {
        for(i = 0;descendant = descendants[i];i++) {
          descendant.setAttribute("unselectable", value)
        }
      }
    }
  }
};
goog.style.getBorderBoxSize = function $goog$style$getBorderBoxSize$(element) {
  return new goog.math.Size(element.offsetWidth, element.offsetHeight)
};
goog.style.setBorderBoxSize = function $goog$style$setBorderBoxSize$(element, size) {
  var doc = goog.dom.getOwnerDocument(element), isCss1CompatMode = goog.dom.getDomHelper(doc).isCss1CompatMode();
  if(goog.userAgent.IE && (!isCss1CompatMode || !goog.userAgent.isVersion("8"))) {
    var style = element.style;
    if(isCss1CompatMode) {
      var paddingBox = goog.style.getPaddingBox(element), borderBox = goog.style.getBorderBox(element);
      style.pixelWidth = size.width - borderBox.left - paddingBox.left - paddingBox.right - borderBox.right;
      style.pixelHeight = size.height - borderBox.top - paddingBox.top - paddingBox.bottom - borderBox.bottom
    }else {
      style.pixelWidth = size.width, style.pixelHeight = size.height
    }
  }else {
    goog.style.setBoxSizingSize_(element, size, "border-box")
  }
};
goog.style.getContentBoxSize = function $goog$style$getContentBoxSize$(element) {
  var doc = goog.dom.getOwnerDocument(element), ieCurrentStyle = goog.userAgent.IE && element.currentStyle;
  if(ieCurrentStyle && goog.dom.getDomHelper(doc).isCss1CompatMode() && "auto" != ieCurrentStyle.width && "auto" != ieCurrentStyle.height && !ieCurrentStyle.boxSizing) {
    var width = goog.style.getIePixelValue_(element, ieCurrentStyle.width, "width", "pixelWidth"), height = goog.style.getIePixelValue_(element, ieCurrentStyle.height, "height", "pixelHeight");
    return new goog.math.Size(width, height)
  }
  var borderBoxSize = goog.style.getBorderBoxSize(element), paddingBox = goog.style.getPaddingBox(element), borderBox = goog.style.getBorderBox(element);
  return new goog.math.Size(borderBoxSize.width - borderBox.left - paddingBox.left - paddingBox.right - borderBox.right, borderBoxSize.height - borderBox.top - paddingBox.top - paddingBox.bottom - borderBox.bottom)
};
goog.style.setContentBoxSize = function $goog$style$setContentBoxSize$(element, size) {
  var doc = goog.dom.getOwnerDocument(element), isCss1CompatMode = goog.dom.getDomHelper(doc).isCss1CompatMode();
  if(goog.userAgent.IE && (!isCss1CompatMode || !goog.userAgent.isVersion("8"))) {
    var style = element.style;
    if(isCss1CompatMode) {
      style.pixelWidth = size.width, style.pixelHeight = size.height
    }else {
      var paddingBox = goog.style.getPaddingBox(element), borderBox = goog.style.getBorderBox(element);
      style.pixelWidth = size.width + borderBox.left + paddingBox.left + paddingBox.right + borderBox.right;
      style.pixelHeight = size.height + borderBox.top + paddingBox.top + paddingBox.bottom + borderBox.bottom
    }
  }else {
    goog.style.setBoxSizingSize_(element, size, "content-box")
  }
};
goog.style.setBoxSizingSize_ = function $goog$style$setBoxSizingSize_$(element, size, boxSizing) {
  var style = element.style;
  goog.userAgent.GECKO ? style.MozBoxSizing = boxSizing : goog.userAgent.WEBKIT ? style.WebkitBoxSizing = boxSizing : style.boxSizing = boxSizing;
  style.width = Math.max(size.width, 0) + "px";
  style.height = Math.max(size.height, 0) + "px"
};
goog.style.getIePixelValue_ = function $goog$style$getIePixelValue_$(element, value, name, pixelName) {
  if(/^\d+px?$/.test(value)) {
    return parseInt(value, 10)
  }
  var oldStyleValue = element.style[name], oldRuntimeValue = element.runtimeStyle[name];
  element.runtimeStyle[name] = element.currentStyle[name];
  element.style[name] = value;
  var pixelValue = element.style[pixelName];
  element.style[name] = oldStyleValue;
  element.runtimeStyle[name] = oldRuntimeValue;
  return pixelValue
};
goog.style.getIePixelDistance_ = function $goog$style$getIePixelDistance_$(element, propName) {
  return goog.style.getIePixelValue_(element, goog.style.getCascadedStyle(element, propName), "left", "pixelLeft")
};
goog.style.getBox_ = function $goog$style$getBox_$(element, stylePrefix) {
  if(goog.userAgent.IE) {
    var left = goog.style.getIePixelDistance_(element, stylePrefix + "Left"), right = goog.style.getIePixelDistance_(element, stylePrefix + "Right"), top = goog.style.getIePixelDistance_(element, stylePrefix + "Top"), bottom = goog.style.getIePixelDistance_(element, stylePrefix + "Bottom");
    return new goog.math.Box(top, right, bottom, left)
  }
  left = goog.style.getComputedStyle(element, stylePrefix + "Left");
  right = goog.style.getComputedStyle(element, stylePrefix + "Right");
  top = goog.style.getComputedStyle(element, stylePrefix + "Top");
  bottom = goog.style.getComputedStyle(element, stylePrefix + "Bottom");
  return new goog.math.Box(parseFloat(top), parseFloat(right), parseFloat(bottom), parseFloat(left))
};
goog.style.getPaddingBox = function $goog$style$getPaddingBox$(element) {
  return goog.style.getBox_(element, "padding")
};
goog.style.getMarginBox = function $goog$style$getMarginBox$(element) {
  return goog.style.getBox_(element, "margin")
};
goog.style.ieBorderWidthKeywords_ = {thin:2, medium:4, thick:6};
goog.style.getIePixelBorder_ = function $goog$style$getIePixelBorder_$(element, prop) {
  if("none" == goog.style.getCascadedStyle(element, prop + "Style")) {
    return 0
  }
  var width = goog.style.getCascadedStyle(element, prop + "Width");
  return width in goog.style.ieBorderWidthKeywords_ ? goog.style.ieBorderWidthKeywords_[width] : goog.style.getIePixelValue_(element, width, "left", "pixelLeft")
};
goog.style.getBorderBox = function $goog$style$getBorderBox$(element) {
  if(goog.userAgent.IE) {
    var left = goog.style.getIePixelBorder_(element, "borderLeft"), right = goog.style.getIePixelBorder_(element, "borderRight"), top = goog.style.getIePixelBorder_(element, "borderTop"), bottom = goog.style.getIePixelBorder_(element, "borderBottom");
    return new goog.math.Box(top, right, bottom, left)
  }
  left = goog.style.getComputedStyle(element, "borderLeftWidth");
  right = goog.style.getComputedStyle(element, "borderRightWidth");
  top = goog.style.getComputedStyle(element, "borderTopWidth");
  bottom = goog.style.getComputedStyle(element, "borderBottomWidth");
  return new goog.math.Box(parseFloat(top), parseFloat(right), parseFloat(bottom), parseFloat(left))
};
goog.style.getFontFamily = function $goog$style$getFontFamily$(el) {
  var doc = goog.dom.getOwnerDocument(el), font = "";
  if(doc.body.createTextRange) {
    var range = doc.body.createTextRange();
    range.moveToElementText(el);
    try {
      font = range.queryCommandValue("FontName")
    }catch(e) {
      font = ""
    }
  }
  font || (font = goog.style.getStyle_(el, "fontFamily"));
  var fontsArray = font.split(",");
  1 < fontsArray.length && (font = fontsArray[0]);
  return goog.string.stripQuotes(font, "\"'")
};
goog.style.lengthUnitRegex_ = /[^\d]+$/;
goog.style.getLengthUnits = function $goog$style$getLengthUnits$(value) {
  var units = value.match(goog.style.lengthUnitRegex_);
  return units && units[0] || null
};
goog.style.ABSOLUTE_CSS_LENGTH_UNITS_ = {cm:1, "in":1, mm:1, pc:1, pt:1};
goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_ = {em:1, ex:1};
goog.style.getFontSize = function $goog$style$getFontSize$(el) {
  var fontSize = goog.style.getStyle_(el, "fontSize"), sizeUnits = goog.style.getLengthUnits(fontSize);
  if(fontSize && "px" == sizeUnits) {
    return parseInt(fontSize, 10)
  }
  if(goog.userAgent.IE) {
    if(sizeUnits in goog.style.ABSOLUTE_CSS_LENGTH_UNITS_) {
      return goog.style.getIePixelValue_(el, fontSize, "left", "pixelLeft")
    }
    if(el.parentNode && el.parentNode.nodeType == goog.dom.NodeType.ELEMENT && sizeUnits in goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_) {
      var parentElement = el.parentNode, parentSize = goog.style.getStyle_(parentElement, "fontSize");
      return goog.style.getIePixelValue_(parentElement, fontSize == parentSize ? "1em" : fontSize, "left", "pixelLeft")
    }
  }
  var sizeElement = goog.dom.createDom("span", {style:"visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;"});
  goog.dom.appendChild(el, sizeElement);
  fontSize = sizeElement.offsetHeight;
  goog.dom.removeNode(sizeElement);
  return fontSize
};
goog.style.parseStyleAttribute = function $goog$style$parseStyleAttribute$(value) {
  var result = {};
  goog.array.forEach(value.split(/\s*;\s*/), function(pair) {
    var keyValue = pair.split(/\s*:\s*/);
    2 == keyValue.length && (result[goog.string.toCamelCase(keyValue[0].toLowerCase())] = keyValue[1])
  });
  return result
};
goog.style.toStyleAttribute = function $goog$style$toStyleAttribute$(obj) {
  var buffer = [];
  goog.object.forEach(obj, function(value, key) {
    buffer.push(goog.string.toSelectorCase(key), ":", value, ";")
  });
  return buffer.join("")
};
goog.style.setFloat = function $goog$style$setFloat$(el, value) {
  el.style[goog.userAgent.IE ? "styleFloat" : "cssFloat"] = value
};
goog.style.getFloat = function $goog$style$getFloat$(el) {
  return el.style[goog.userAgent.IE ? "styleFloat" : "cssFloat"] || ""
};
goog.style.getScrollbarWidth = function $goog$style$getScrollbarWidth$(opt_className) {
  var outerDiv = goog.dom.createElement("div");
  opt_className && (outerDiv.className = opt_className);
  outerDiv.style.cssText = "overflow:auto;position:absolute;top:0;width:100px;height:100px";
  var innerDiv = goog.dom.createElement("div");
  goog.style.setSize(innerDiv, "200px", "200px");
  outerDiv.appendChild(innerDiv);
  goog.dom.appendChild(goog.dom.getDocument().body, outerDiv);
  var width = outerDiv.offsetWidth - outerDiv.clientWidth;
  goog.dom.removeNode(outerDiv);
  return width
};
goog.style.bidi = {};
goog.style.bidi.getScrollLeft = function $goog$style$bidi$getScrollLeft$(element) {
  var isRtl = goog.style.isRightToLeft(element);
  return isRtl && goog.userAgent.GECKO ? -element.scrollLeft : isRtl && (!goog.userAgent.IE || !goog.userAgent.isVersion("8")) ? element.scrollWidth - element.clientWidth - element.scrollLeft : element.scrollLeft
};
goog.style.bidi.getOffsetStart = function $goog$style$bidi$getOffsetStart$(element) {
  var offsetLeftForReal = element.offsetLeft, bestParent = element.offsetParent;
  !bestParent && "fixed" == goog.style.getComputedPosition(element) && (bestParent = goog.dom.getOwnerDocument(element).documentElement);
  if(!bestParent) {
    return offsetLeftForReal
  }
  if(goog.userAgent.GECKO) {
    var borderWidths = goog.style.getBorderBox(bestParent), offsetLeftForReal = offsetLeftForReal + borderWidths.left
  }else {
    goog.userAgent.isDocumentMode(8) && (borderWidths = goog.style.getBorderBox(bestParent), offsetLeftForReal -= borderWidths.left)
  }
  if(goog.style.isRightToLeft(bestParent)) {
    var elementRightOffset = offsetLeftForReal + element.offsetWidth;
    return bestParent.clientWidth - elementRightOffset
  }
  return offsetLeftForReal
};
goog.style.bidi.setScrollOffset = function $goog$style$bidi$setScrollOffset$(element, offsetStart) {
  offsetStart = Math.max(offsetStart, 0);
  element.scrollLeft = goog.style.isRightToLeft(element) ? goog.userAgent.GECKO ? -offsetStart : !goog.userAgent.IE || !goog.userAgent.isVersion("8") ? element.scrollWidth - offsetStart - element.clientWidth : offsetStart : offsetStart
};
goog.positioning = {};
goog.positioning.Corner = {TOP_LEFT:0, TOP_RIGHT:2, BOTTOM_LEFT:1, BOTTOM_RIGHT:3, TOP_START:4, TOP_END:6, BOTTOM_START:5, BOTTOM_END:7};
goog.positioning.CornerBit = {BOTTOM:1, RIGHT:2, FLIP_RTL:4};
goog.positioning.Overflow = {IGNORE:0, ADJUST_X:1, FAIL_X:2, ADJUST_Y:4, FAIL_Y:8, RESIZE_WIDTH:16, RESIZE_HEIGHT:32, ADJUST_X_EXCEPT_OFFSCREEN:65, ADJUST_Y_EXCEPT_OFFSCREEN:132};
goog.positioning.OverflowStatus = {NONE:0, ADJUSTED_X:1, ADJUSTED_Y:2, WIDTH_ADJUSTED:4, HEIGHT_ADJUSTED:8, FAILED_LEFT:16, FAILED_RIGHT:32, FAILED_TOP:64, FAILED_BOTTOM:128, FAILED_OUTSIDE_VIEWPORT:256};
goog.positioning.OverflowStatus.FAILED = goog.positioning.OverflowStatus.FAILED_LEFT | goog.positioning.OverflowStatus.FAILED_RIGHT | goog.positioning.OverflowStatus.FAILED_TOP | goog.positioning.OverflowStatus.FAILED_BOTTOM | goog.positioning.OverflowStatus.FAILED_OUTSIDE_VIEWPORT;
goog.positioning.OverflowStatus.FAILED_HORIZONTAL = goog.positioning.OverflowStatus.FAILED_LEFT | goog.positioning.OverflowStatus.FAILED_RIGHT;
goog.positioning.OverflowStatus.FAILED_VERTICAL = goog.positioning.OverflowStatus.FAILED_TOP | goog.positioning.OverflowStatus.FAILED_BOTTOM;
goog.positioning.positionAtAnchor = function $goog$positioning$positionAtAnchor$(anchorElement, anchorElementCorner, movableElement, movableElementCorner, opt_offset, opt_margin, opt_overflow, opt_preferredSize) {
  var moveableParentTopLeft, parent = movableElement.offsetParent;
  if(parent) {
    var isBody = parent.tagName == goog.dom.TagName.HTML || parent.tagName == goog.dom.TagName.BODY;
    if(!isBody || "static" != goog.style.getComputedPosition(parent)) {
      moveableParentTopLeft = goog.style.getPageOffset(parent), isBody || (moveableParentTopLeft = goog.math.Coordinate.difference(moveableParentTopLeft, new goog.math.Coordinate(goog.style.bidi.getScrollLeft(parent), parent.scrollTop)))
    }
  }
  var anchorRect = goog.positioning.getVisiblePart_(anchorElement);
  goog.style.translateRectForAnotherFrame(anchorRect, goog.dom.getDomHelper(anchorElement), goog.dom.getDomHelper(movableElement));
  var corner = goog.positioning.getEffectiveCorner(anchorElement, anchorElementCorner), absolutePos = new goog.math.Coordinate(corner & goog.positioning.CornerBit.RIGHT ? anchorRect.left + anchorRect.width : anchorRect.left, corner & goog.positioning.CornerBit.BOTTOM ? anchorRect.top + anchorRect.height : anchorRect.top);
  moveableParentTopLeft && (absolutePos = goog.math.Coordinate.difference(absolutePos, moveableParentTopLeft));
  opt_offset && (absolutePos.x += (corner & goog.positioning.CornerBit.RIGHT ? -1 : 1) * opt_offset.x, absolutePos.y += (corner & goog.positioning.CornerBit.BOTTOM ? -1 : 1) * opt_offset.y);
  var viewport;
  if(opt_overflow && (viewport = goog.style.getVisibleRectForElement(movableElement)) && moveableParentTopLeft) {
    viewport.top -= moveableParentTopLeft.y, viewport.right -= moveableParentTopLeft.x, viewport.bottom -= moveableParentTopLeft.y, viewport.left -= moveableParentTopLeft.x
  }
  return goog.positioning.positionAtCoordinate(absolutePos, movableElement, movableElementCorner, opt_margin, viewport, opt_overflow, opt_preferredSize)
};
goog.positioning.getVisiblePart_ = function $goog$positioning$getVisiblePart_$(el) {
  var rect = goog.style.getBounds(el), visibleBox = goog.style.getVisibleRectForElement(el);
  visibleBox && rect.intersection(goog.math.Rect.createFromBox(visibleBox));
  return rect
};
goog.positioning.positionAtCoordinate = function $goog$positioning$positionAtCoordinate$(absolutePos, movableElement, movableElementCorner, opt_margin, opt_viewport, opt_overflow, opt_preferredSize) {
  var absolutePos = absolutePos.clone(), status = goog.positioning.OverflowStatus.NONE, corner = goog.positioning.getEffectiveCorner(movableElement, movableElementCorner), elementSize = goog.style.getSize(movableElement), size = opt_preferredSize ? opt_preferredSize.clone() : elementSize.clone();
  if(opt_margin || corner != goog.positioning.Corner.TOP_LEFT) {
    (corner & goog.positioning.CornerBit.RIGHT ? absolutePos.x -= size.width + (opt_margin ? opt_margin.right : 0) : opt_margin && (absolutePos.x += opt_margin.left), corner & goog.positioning.CornerBit.BOTTOM) ? absolutePos.y -= size.height + (opt_margin ? opt_margin.bottom : 0) : opt_margin && (absolutePos.y += opt_margin.top)
  }
  if(opt_overflow && (status = opt_viewport ? goog.positioning.adjustForViewport_(absolutePos, size, opt_viewport, opt_overflow) : goog.positioning.OverflowStatus.FAILED_OUTSIDE_VIEWPORT, status & goog.positioning.OverflowStatus.FAILED)) {
    return status
  }
  goog.style.setPosition(movableElement, absolutePos);
  goog.math.Size.equals(elementSize, size) || goog.style.setBorderBoxSize(movableElement, size);
  return status
};
goog.positioning.adjustForViewport_ = function $goog$positioning$adjustForViewport_$(pos, size, viewport, overflow) {
  var status = goog.positioning.OverflowStatus.NONE, ADJUST_X_EXCEPT_OFFSCREEN = goog.positioning.Overflow.ADJUST_X_EXCEPT_OFFSCREEN, ADJUST_Y_EXCEPT_OFFSCREEN = goog.positioning.Overflow.ADJUST_Y_EXCEPT_OFFSCREEN;
  if((overflow & ADJUST_X_EXCEPT_OFFSCREEN) == ADJUST_X_EXCEPT_OFFSCREEN && (pos.x < viewport.left || pos.x >= viewport.right)) {
    overflow &= ~goog.positioning.Overflow.ADJUST_X
  }
  if((overflow & ADJUST_Y_EXCEPT_OFFSCREEN) == ADJUST_Y_EXCEPT_OFFSCREEN && (pos.y < viewport.top || pos.y >= viewport.bottom)) {
    overflow &= ~goog.positioning.Overflow.ADJUST_Y
  }
  pos.x < viewport.left && overflow & goog.positioning.Overflow.ADJUST_X && (pos.x = viewport.left, status |= goog.positioning.OverflowStatus.ADJUSTED_X);
  pos.x < viewport.left && pos.x + size.width > viewport.right && overflow & goog.positioning.Overflow.RESIZE_WIDTH && (size.width = Math.max(size.width - (pos.x + size.width - viewport.right), 0), status |= goog.positioning.OverflowStatus.WIDTH_ADJUSTED);
  pos.x + size.width > viewport.right && overflow & goog.positioning.Overflow.ADJUST_X && (pos.x = Math.max(viewport.right - size.width, viewport.left), status |= goog.positioning.OverflowStatus.ADJUSTED_X);
  overflow & goog.positioning.Overflow.FAIL_X && (status |= (pos.x < viewport.left ? goog.positioning.OverflowStatus.FAILED_LEFT : 0) | (pos.x + size.width > viewport.right ? goog.positioning.OverflowStatus.FAILED_RIGHT : 0));
  pos.y < viewport.top && overflow & goog.positioning.Overflow.ADJUST_Y && (pos.y = viewport.top, status |= goog.positioning.OverflowStatus.ADJUSTED_Y);
  pos.y >= viewport.top && pos.y + size.height > viewport.bottom && overflow & goog.positioning.Overflow.RESIZE_HEIGHT && (size.height = Math.max(size.height - (pos.y + size.height - viewport.bottom), 0), status |= goog.positioning.OverflowStatus.HEIGHT_ADJUSTED);
  pos.y + size.height > viewport.bottom && overflow & goog.positioning.Overflow.ADJUST_Y && (pos.y = Math.max(viewport.bottom - size.height, viewport.top), status |= goog.positioning.OverflowStatus.ADJUSTED_Y);
  overflow & goog.positioning.Overflow.FAIL_Y && (status |= (pos.y < viewport.top ? goog.positioning.OverflowStatus.FAILED_TOP : 0) | (pos.y + size.height > viewport.bottom ? goog.positioning.OverflowStatus.FAILED_BOTTOM : 0));
  return status
};
goog.positioning.getEffectiveCorner = function $goog$positioning$getEffectiveCorner$(element, corner) {
  return(corner & goog.positioning.CornerBit.FLIP_RTL && goog.style.isRightToLeft(element) ? corner ^ goog.positioning.CornerBit.RIGHT : corner) & ~goog.positioning.CornerBit.FLIP_RTL
};
goog.positioning.flipCornerHorizontal = function $goog$positioning$flipCornerHorizontal$(corner) {
  return corner ^ goog.positioning.CornerBit.RIGHT
};
goog.positioning.flipCornerVertical = function $goog$positioning$flipCornerVertical$(corner) {
  return corner ^ goog.positioning.CornerBit.BOTTOM
};
goog.positioning.flipCorner = function $goog$positioning$flipCorner$(corner) {
  return corner ^ goog.positioning.CornerBit.BOTTOM ^ goog.positioning.CornerBit.RIGHT
};
goog.positioning.AbstractPosition = function $goog$positioning$AbstractPosition$() {
};
goog.positioning.AbstractPosition.prototype.reposition = function $goog$positioning$AbstractPosition$$reposition$() {
};
goog.events.EventHandler = function $goog$events$EventHandler$(opt_handler) {
  goog.Disposable.call(this);
  this.handler_ = opt_handler;
  this.keys_ = []
};
goog.inherits(goog.events.EventHandler, goog.Disposable);
goog.events.EventHandler.typeArray_ = [];
goog.events.EventHandler.prototype.listen = function $goog$events$EventHandler$$listen$(src, type, opt_fn, opt_capture, opt_handler) {
  goog.isArray(type) || (goog.events.EventHandler.typeArray_[0] = type, type = goog.events.EventHandler.typeArray_);
  for(var i = 0;i < type.length;i++) {
    var key = goog.events.listen(src, type[i], opt_fn || this, opt_capture || !1, opt_handler || this.handler_ || this);
    this.keys_.push(key)
  }
  return this
};
goog.events.EventHandler.prototype.listenOnce = function $goog$events$EventHandler$$listenOnce$(src, type, opt_fn, opt_capture, opt_handler) {
  if(goog.isArray(type)) {
    for(var i = 0;i < type.length;i++) {
      this.listenOnce(src, type[i], opt_fn, opt_capture, opt_handler)
    }
  }else {
    var key = goog.events.listenOnce(src, type, opt_fn || this, opt_capture, opt_handler || this.handler_ || this);
    this.keys_.push(key)
  }
  return this
};
goog.events.EventHandler.prototype.listenWithWrapper = function $goog$events$EventHandler$$listenWithWrapper$(src, wrapper, listener, opt_capt, opt_handler) {
  wrapper.listen(src, listener, opt_capt, opt_handler || this.handler_, this);
  return this
};
goog.events.EventHandler.prototype.unlisten = function $goog$events$EventHandler$$unlisten$(src, type, opt_fn, opt_capture, opt_handler) {
  if(goog.isArray(type)) {
    for(var i = 0;i < type.length;i++) {
      this.unlisten(src, type[i], opt_fn, opt_capture, opt_handler)
    }
  }else {
    var listener = goog.events.getListener(src, type, opt_fn || this, opt_capture, opt_handler || this.handler_ || this);
    if(listener) {
      var key = listener.key;
      goog.events.unlistenByKey(key);
      goog.array.remove(this.keys_, key)
    }
  }
  return this
};
goog.events.EventHandler.prototype.unlistenWithWrapper = function $goog$events$EventHandler$$unlistenWithWrapper$(src, wrapper, listener, opt_capt, opt_handler) {
  wrapper.unlisten(src, listener, opt_capt, opt_handler || this.handler_, this);
  return this
};
goog.events.EventHandler.prototype.removeAll = function $goog$events$EventHandler$$removeAll$() {
  goog.array.forEach(this.keys_, goog.events.unlistenByKey);
  this.keys_.length = 0
};
goog.events.EventHandler.prototype.disposeInternal = function $goog$events$EventHandler$$disposeInternal$() {
  goog.events.EventHandler.superClass_.disposeInternal.call(this);
  this.removeAll()
};
goog.events.EventHandler.prototype.handleEvent = function $goog$events$EventHandler$$handleEvent$() {
  throw Error("EventHandler.handleEvent not implemented");
};
goog.ui = {};
goog.ui.IdGenerator = function $goog$ui$IdGenerator$() {
};
goog.addSingletonGetter(goog.ui.IdGenerator);
goog.ui.IdGenerator.prototype.nextId_ = 0;
goog.ui.IdGenerator.prototype.getNextUniqueId = function $goog$ui$IdGenerator$$getNextUniqueId$() {
  return":" + (this.nextId_++).toString(36)
};
goog.ui.IdGenerator.instance = goog.ui.IdGenerator.getInstance();
goog.ui.Component = function $goog$ui$Component$(opt_domHelper) {
  goog.events.EventTarget.call(this);
  this.dom_ = opt_domHelper || goog.dom.getDomHelper();
  this.rightToLeft_ = goog.ui.Component.defaultRightToLeft_
};
goog.inherits(goog.ui.Component, goog.events.EventTarget);
goog.ui.Component.prototype.idGenerator_ = goog.ui.IdGenerator.getInstance();
goog.ui.Component.defaultRightToLeft_ = null;
goog.ui.Component.EventType = {BEFORE_SHOW:"beforeshow", SHOW:"show", HIDE:"hide", DISABLE:"disable", ENABLE:"enable", HIGHLIGHT:"highlight", UNHIGHLIGHT:"unhighlight", ACTIVATE:"activate", DEACTIVATE:"deactivate", SELECT:"select", UNSELECT:"unselect", CHECK:"check", UNCHECK:"uncheck", FOCUS:"focus", BLUR:"blur", OPEN:"open", CLOSE:"close", ENTER:"enter", LEAVE:"leave", ACTION:"action", CHANGE:"change"};
goog.ui.Component.Error = {NOT_SUPPORTED:"Method not supported", DECORATE_INVALID:"Invalid element to decorate", ALREADY_RENDERED:"Component already rendered", PARENT_UNABLE_TO_BE_SET:"Unable to set parent component", CHILD_INDEX_OUT_OF_BOUNDS:"Child component index out of bounds", NOT_OUR_CHILD:"Child is not in parent component", NOT_IN_DOCUMENT:"Operation not supported while component is not in document", STATE_INVALID:"Invalid component state"};
goog.ui.Component.State = {ALL:255, DISABLED:1, HOVER:2, ACTIVE:4, SELECTED:8, CHECKED:16, FOCUSED:32, OPENED:64};
goog.ui.Component.getStateTransitionEvent = function $goog$ui$Component$getStateTransitionEvent$(state, isEntering) {
  switch(state) {
    case goog.ui.Component.State.DISABLED:
      return isEntering ? goog.ui.Component.EventType.DISABLE : goog.ui.Component.EventType.ENABLE;
    case goog.ui.Component.State.HOVER:
      return isEntering ? goog.ui.Component.EventType.HIGHLIGHT : goog.ui.Component.EventType.UNHIGHLIGHT;
    case goog.ui.Component.State.ACTIVE:
      return isEntering ? goog.ui.Component.EventType.ACTIVATE : goog.ui.Component.EventType.DEACTIVATE;
    case goog.ui.Component.State.SELECTED:
      return isEntering ? goog.ui.Component.EventType.SELECT : goog.ui.Component.EventType.UNSELECT;
    case goog.ui.Component.State.CHECKED:
      return isEntering ? goog.ui.Component.EventType.CHECK : goog.ui.Component.EventType.UNCHECK;
    case goog.ui.Component.State.FOCUSED:
      return isEntering ? goog.ui.Component.EventType.FOCUS : goog.ui.Component.EventType.BLUR;
    case goog.ui.Component.State.OPENED:
      return isEntering ? goog.ui.Component.EventType.OPEN : goog.ui.Component.EventType.CLOSE
  }
  throw Error(goog.ui.Component.Error.STATE_INVALID);
};
goog.ui.Component.setDefaultRightToLeft = function $goog$ui$Component$setDefaultRightToLeft$(rightToLeft) {
  goog.ui.Component.defaultRightToLeft_ = rightToLeft
};
goog.ui.Component.prototype.id_ = null;
goog.ui.Component.prototype.inDocument_ = !1;
goog.ui.Component.prototype.element_ = null;
goog.ui.Component.prototype.rightToLeft_ = null;
goog.ui.Component.prototype.model_ = null;
goog.ui.Component.prototype.parent_ = null;
goog.ui.Component.prototype.children_ = null;
goog.ui.Component.prototype.childIndex_ = null;
goog.ui.Component.prototype.wasDecorated_ = !1;
goog.ui.Component.prototype.getId = function $goog$ui$Component$$getId$() {
  return this.id_ || (this.id_ = this.idGenerator_.getNextUniqueId())
};
goog.ui.Component.prototype.setId = function $goog$ui$Component$$setId$(id) {
  this.parent_ && this.parent_.childIndex_ && (goog.object.remove(this.parent_.childIndex_, this.id_), goog.object.add(this.parent_.childIndex_, id, this));
  this.id_ = id
};
goog.ui.Component.prototype.getElement = function $goog$ui$Component$$getElement$() {
  return this.element_
};
goog.ui.Component.prototype.setElementInternal = function $goog$ui$Component$$setElementInternal$(element) {
  this.element_ = element
};
goog.ui.Component.prototype.getElementsByClass = function $goog$ui$Component$$getElementsByClass$(className) {
  return this.element_ ? this.dom_.getElementsByClass(className, this.element_) : []
};
goog.ui.Component.prototype.getElementByClass = function $goog$ui$Component$$getElementByClass$(className) {
  return this.element_ ? this.dom_.getElementByClass(className, this.element_) : null
};
goog.ui.Component.prototype.getHandler = function $goog$ui$Component$$getHandler$() {
  return this.googUiComponentHandler_ || (this.googUiComponentHandler_ = new goog.events.EventHandler(this))
};
goog.ui.Component.prototype.setParent = function $goog$ui$Component$$setParent$(parent) {
  if(this == parent) {
    throw Error(goog.ui.Component.Error.PARENT_UNABLE_TO_BE_SET);
  }
  if(parent && this.parent_ && this.id_ && this.parent_.getChild(this.id_) && this.parent_ != parent) {
    throw Error(goog.ui.Component.Error.PARENT_UNABLE_TO_BE_SET);
  }
  this.parent_ = parent;
  goog.ui.Component.superClass_.setParentEventTarget.call(this, parent)
};
goog.ui.Component.prototype.getParent = function $goog$ui$Component$$getParent$() {
  return this.parent_
};
goog.ui.Component.prototype.setParentEventTarget = function $goog$ui$Component$$setParentEventTarget$(parent) {
  if(this.parent_ && this.parent_ != parent) {
    throw Error(goog.ui.Component.Error.NOT_SUPPORTED);
  }
  goog.ui.Component.superClass_.setParentEventTarget.call(this, parent)
};
goog.ui.Component.prototype.getDomHelper = function $goog$ui$Component$$getDomHelper$() {
  return this.dom_
};
goog.ui.Component.prototype.isInDocument = function $goog$ui$Component$$isInDocument$() {
  return this.inDocument_
};
goog.ui.Component.prototype.createDom = function $goog$ui$Component$$createDom$() {
  this.element_ = this.dom_.createElement("div")
};
goog.ui.Component.prototype.render = function $goog$ui$Component$$render$(opt_parentElement) {
  this.render_(opt_parentElement)
};
goog.ui.Component.prototype.render_ = function $goog$ui$Component$$render_$(opt_parentElement, opt_beforeNode) {
  if(this.inDocument_) {
    throw Error(goog.ui.Component.Error.ALREADY_RENDERED);
  }
  this.element_ || this.createDom();
  opt_parentElement ? opt_parentElement.insertBefore(this.element_, opt_beforeNode || null) : this.dom_.getDocument().body.appendChild(this.element_);
  (!this.parent_ || this.parent_.isInDocument()) && this.enterDocument()
};
goog.ui.Component.prototype.decorate = function $goog$ui$Component$$decorate$(element) {
  if(this.inDocument_) {
    throw Error(goog.ui.Component.Error.ALREADY_RENDERED);
  }
  if(element && this.canDecorate(element)) {
    this.wasDecorated_ = !0;
    if(!this.dom_ || this.dom_.getDocument() != goog.dom.getOwnerDocument(element)) {
      this.dom_ = goog.dom.getDomHelper(element)
    }
    this.decorateInternal(element);
    this.enterDocument()
  }else {
    throw Error(goog.ui.Component.Error.DECORATE_INVALID);
  }
};
goog.ui.Component.prototype.canDecorate = function $goog$ui$Component$$canDecorate$() {
  return!0
};
goog.ui.Component.prototype.decorateInternal = function $goog$ui$Component$$decorateInternal$(element) {
  this.element_ = element
};
goog.ui.Component.prototype.enterDocument = function $goog$ui$Component$$enterDocument$() {
  this.inDocument_ = !0;
  this.forEachChild(function(child) {
    !child.isInDocument() && child.getElement() && child.enterDocument()
  })
};
goog.ui.Component.prototype.exitDocument = function $goog$ui$Component$$exitDocument$() {
  this.forEachChild(function(child) {
    child.isInDocument() && child.exitDocument()
  });
  this.googUiComponentHandler_ && this.googUiComponentHandler_.removeAll();
  this.inDocument_ = !1
};
goog.ui.Component.prototype.disposeInternal = function $goog$ui$Component$$disposeInternal$() {
  goog.ui.Component.superClass_.disposeInternal.call(this);
  this.inDocument_ && this.exitDocument();
  this.googUiComponentHandler_ && (this.googUiComponentHandler_.dispose(), delete this.googUiComponentHandler_);
  this.forEachChild(function(child) {
    child.dispose()
  });
  !this.wasDecorated_ && this.element_ && goog.dom.removeNode(this.element_);
  this.parent_ = this.model_ = this.element_ = this.childIndex_ = this.children_ = null
};
goog.ui.Component.prototype.getModel = function $goog$ui$Component$$getModel$() {
  return this.model_
};
goog.ui.Component.prototype.setModel = function $goog$ui$Component$$setModel$(obj) {
  this.model_ = obj
};
goog.ui.Component.prototype.addChild = function $goog$ui$Component$$addChild$(child, opt_render) {
  this.addChildAt(child, this.getChildCount(), opt_render)
};
goog.ui.Component.prototype.addChildAt = function $goog$ui$Component$$addChildAt$(child, index, opt_render) {
  if(child.inDocument_ && (opt_render || !this.inDocument_)) {
    throw Error(goog.ui.Component.Error.ALREADY_RENDERED);
  }
  if(0 > index || index > this.getChildCount()) {
    throw Error(goog.ui.Component.Error.CHILD_INDEX_OUT_OF_BOUNDS);
  }
  if(!this.childIndex_ || !this.children_) {
    this.childIndex_ = {}, this.children_ = []
  }
  child.getParent() == this ? (goog.object.set(this.childIndex_, child.getId(), child), goog.array.remove(this.children_, child)) : goog.object.add(this.childIndex_, child.getId(), child);
  child.setParent(this);
  goog.array.insertAt(this.children_, child, index);
  if(child.inDocument_ && this.inDocument_ && child.getParent() == this) {
    var contentElement = this.getContentElement();
    contentElement.insertBefore(child.getElement(), contentElement.childNodes[index] || null)
  }else {
    if(opt_render) {
      this.element_ || this.createDom();
      var sibling = this.getChildAt(index + 1);
      child.render_(this.getContentElement(), sibling ? sibling.element_ : null)
    }else {
      this.inDocument_ && !child.inDocument_ && child.element_ && child.enterDocument()
    }
  }
};
goog.ui.Component.prototype.getContentElement = function $goog$ui$Component$$getContentElement$() {
  return this.element_
};
goog.ui.Component.prototype.isRightToLeft = function $goog$ui$Component$$isRightToLeft$() {
  null == this.rightToLeft_ && (this.rightToLeft_ = goog.style.isRightToLeft(this.inDocument_ ? this.element_ : this.dom_.getDocument().body));
  return this.rightToLeft_
};
goog.ui.Component.prototype.setRightToLeft = function $goog$ui$Component$$setRightToLeft$(rightToLeft) {
  if(this.inDocument_) {
    throw Error(goog.ui.Component.Error.ALREADY_RENDERED);
  }
  this.rightToLeft_ = rightToLeft
};
goog.ui.Component.prototype.hasChildren = function $goog$ui$Component$$hasChildren$() {
  return!!this.children_ && 0 != this.children_.length
};
goog.ui.Component.prototype.getChildCount = function $goog$ui$Component$$getChildCount$() {
  return this.children_ ? this.children_.length : 0
};
goog.ui.Component.prototype.getChild = function $goog$ui$Component$$getChild$(id) {
  return this.childIndex_ && id ? goog.object.get(this.childIndex_, id) || null : null
};
goog.ui.Component.prototype.getChildAt = function $goog$ui$Component$$getChildAt$(index) {
  return this.children_ ? this.children_[index] || null : null
};
goog.ui.Component.prototype.forEachChild = function $goog$ui$Component$$forEachChild$(f, opt_obj) {
  this.children_ && goog.array.forEach(this.children_, f, opt_obj)
};
goog.ui.Component.prototype.indexOfChild = function $goog$ui$Component$$indexOfChild$(child) {
  return this.children_ && child ? goog.array.indexOf(this.children_, child) : -1
};
goog.ui.Component.prototype.removeChild = function $goog$ui$Component$$removeChild$(child, opt_unrender) {
  if(child) {
    var id = goog.isString(child) ? child : child.getId(), child = this.getChild(id);
    id && child && (goog.object.remove(this.childIndex_, id), goog.array.remove(this.children_, child), opt_unrender && (child.exitDocument(), child.element_ && goog.dom.removeNode(child.element_)), child.setParent(null))
  }
  if(!child) {
    throw Error(goog.ui.Component.Error.NOT_OUR_CHILD);
  }
  return child
};
goog.ui.Component.prototype.removeChildAt = function $goog$ui$Component$$removeChildAt$(index, opt_unrender) {
  return this.removeChild(this.getChildAt(index), opt_unrender)
};
goog.ui.Component.prototype.removeChildren = function $goog$ui$Component$$removeChildren$(opt_unrender) {
  for(var removedChildren = [];this.hasChildren();) {
    removedChildren.push(this.removeChildAt(0, opt_unrender))
  }
  return removedChildren
};
goog.ime.keyboard = {};
goog.ime.keyboard.KeyCode = {};
goog.ime.keyboard.KeyCode.CODES101 = "\u00c01234567890\u00bd\u00bbQWERTYUIOP\u00db\u00dd\u00dcASDFGHJKL\u00ba\u00deZXCVBNM\u00bc\u00be\u00bf ";
goog.ime.keyboard.KeyCode.CODES102 = "\u00c01234567890\u00bd\u00bbQWERTYUIOP\u00db\u00ddASDFGHJKL\u00ba\u00de\u00dc\u00e2ZXCVBNM\u00bc\u00be\u00bf ";
goog.ime.keyboard.KeyCode.ALLCODES101 = "\u00c01234567890\u00bd\u00bb\u0008\tQWERTYUIOP\u00db\u00dd\u00dc\u0014ASDFGHJKL\u00ba\u00de\r\u0010ZXCVBNM\u00bc\u00be\u00bf\u0010\u0111 \u0111";
goog.ime.keyboard.KeyCode.ALLCODES102 = "\u00c01234567890\u00bd\u00bb\u0008\tQWERTYUIOP\u00db\u00dd\r\u0014ASDFGHJKL\u00ba\u00de\u00dc\r\u0010\u00e2ZXCVBNM\u00bc\u00be\u00bf\u0010\u0111 \u0111";
goog.ime.keyboard.KeyCode.OEM_CODES = {de:{Y:90, Z:89, "\u00dc":192, "\u00db":189, "\u00dd":187, "\u00ba":219, "\u00bb":221, "\u00bf":220, "\u00cc":186, "\u00bd":191}, fr:{Q:65, A:81, Z:87, W:90, "\u00dd":219, "\u00ba":221, M:186, "\u00c0":222, "\u00de":192, "\u00bc":77, "\u00be":188, "\u00bf":190, "\u00df":191, "\u00db":189}};
goog.ime.keyboard.KeyCode.MOZ_CODES = {59:186, 61:187, 107:187, 109:189};
goog.ime.keyboard.KeyCode.MOZ_SHIFT_CHAR_CODES = {126:192, 95:189, 124:220, 58:186, 60:188, 62:190, 63:191};
goog.ime.keyboard.ParsedLayout = function $goog$ime$keyboard$ParsedLayout$(layout) {
  this.id = layout.id;
  this.view = {id:layout.id, title:layout.title, isRTL:"rtl" == layout.direction, is102:layout.is102Keyboard, "":null, s:null, c:null, l:null, sc:null, cl:null, sl:null, scl:null};
  this.ambiRegex_ = this.transforms_ = null;
  this.parseKeyMappings_(layout);
  this.parseTransforms_(layout)
};
goog.ime.keyboard.ParsedLayout.prototype.parseKeyMappings_ = function $goog$ime$keyboard$ParsedLayout$$parseKeyMappings_$(layout) {
  var codes = this.view.is102 ? goog.ime.keyboard.KeyCode.CODES102 : goog.ime.keyboard.KeyCode.CODES101, mappings = layout.mappings, m;
  for(m in mappings) {
    var map = mappings[m], modes = m.split(/,/);
    modes.join(",") != m && modes.push("");
    var parsed = {}, from;
    for(from in map) {
      var to = map[from];
      if("" == from && (from = codes, this.view.is102)) {
        var normalizedTo = to.slice(0, 25), normalizedTo = normalizedTo + to.slice(26, 37), normalizedTo = normalizedTo + to.charAt(25), to = normalizedTo += to.slice(37)
      }
      from = from.replace("m", "\u00bd");
      from = from.replace("=", "\u00bb");
      from = from.replace(";", "\u00ba");
      if(1 == from.length) {
        parsed[from] = ["S", to, to]
      }else {
        for(var j = 0, i = 0, c;c = from.charAt(i);++i) {
          var t = to.charAt(j++);
          if(t == to.charAt(j) && "{" == t) {
            var k = to.indexOf("}}", j);
            if(k < j) {
              break
            }
            var s = to.slice(j + 1, k), parts = s.split("||");
            3 == parts.length ? parsed[c] = parts : 1 == parts.length && (parsed[c] = ["S", s, s]);
            j = k + 2
          }else {
            parsed[c] = ["S", t, t]
          }
        }
      }
    }
    for(var i = 0, mode;mode = modes[i], void 0 != mode;++i) {
      this.view[mode] = parsed
    }
  }
};
goog.ime.keyboard.ParsedLayout.prototype.parseTransforms_ = function $goog$ime$keyboard$ParsedLayout$$parseTransforms_$(layout) {
  var transforms = layout.transform;
  if(transforms) {
    var regobjs = [], regexesalone = [], sum_numgrps = 1, regex;
    for(regex in transforms) {
      var regobj = RegExp(regex + "$"), repl = transforms[regex];
      regobjs[sum_numgrps] = [regobj, repl];
      regexesalone.push("(" + regex + "$)");
      var grpCountRegexp = RegExp(regex + "|.*"), numgrps = grpCountRegexp.exec("").length, sum_numgrps = sum_numgrps + numgrps
    }
    var longregobj = RegExp(regexesalone.join("|"));
    this.transforms_ = [longregobj, regobjs]
  }
  var hisPruReg = layout.historyPruneRegex;
  hisPruReg && (this.ambiRegex_ = RegExp("^(" + hisPruReg + ")$"))
};
goog.ime.keyboard.ParsedLayout.prototype.transform = function $goog$ime$keyboard$ParsedLayout$$transform$(prevstr, transat, ch) {
  if(!this.transforms_) {
    return null
  }
  var str;
  str = 0 < transat ? prevstr.slice(0, transat) + "\u001d" + prevstr.slice(transat) + ch : prevstr + ch;
  var longr = this.transforms_[0], matchArr = longr.exec(str);
  if(matchArr) {
    for(var rs = this.transforms_[1], i = 1;i < matchArr.length && !matchArr[i];i++) {
    }
    var matchGroup = i, regobj = rs[matchGroup][0], repl = rs[matchGroup][1], m = regobj.exec(str), rmstr = str.slice(m.index), numseps = -1 < rmstr.search("\u001d") ? 1 : 0, backlen = rmstr.length - numseps - ch.length, newstr = str.replace(regobj, repl), replstr = newstr.slice(m.index), replstr = replstr.replace("\u001d", "");
    return{back:backlen, chars:replstr}
  }
  return null
};
goog.ime.keyboard.ParsedLayout.prototype.isAmbiChars = function $goog$ime$keyboard$ParsedLayout$$isAmbiChars$(chars) {
  return this.ambiRegex_ ? !!this.ambiRegex_.exec(chars) : !1
};
goog.ime.keyboard.Module = function $goog$ime$keyboard$Module$(layoutActivatedCallback) {
  this.layoutActivatedCallback_ = layoutActivatedCallback;
  this.layouts_ = {};
  this.delayActiveLayout_ = this.activeLayout_ = "";
  this.historyState_ = {previous:{text:"", transat:-1}, ambi:"", current:{text:"", transat:-1}};
  this.HISTORY_TEXT_LEN_ = 20;
  goog.exportSymbol("google.elements.keyboard.loadme", goog.bind(this.onLayoutLoaded_, this))
};
goog.ime.keyboard.Module.STATIC_DIR = "//ssl.gstatic.com/inputtools/js/kbd/";
goog.ime.keyboard.Module.prototype.loadLayout = function $goog$ime$keyboard$Module$$loadLayout$(layoutCode) {
  layoutCode && void 0 == this.layouts_[layoutCode] && (this.layouts_[layoutCode] = !1, "ko" == layoutCode && (layoutCode = "hangul"), goog.ime.keyboard.Module.loadLayoutScript_(layoutCode))
};
goog.ime.keyboard.Module.prototype.activateLayout = function $goog$ime$keyboard$Module$$activateLayout$(layoutCode) {
  if(layoutCode && this.activeLayout_ != layoutCode) {
    var parsedLayout = this.layouts_[layoutCode];
    parsedLayout ? (this.activeLayout_ = layoutCode, this.delayActiveLayout_ = "", this.clearHistory_(), this.layoutActivatedCallback_(parsedLayout.view)) : !1 == parsedLayout && (this.delayActiveLayout_ = layoutCode)
  }
};
goog.ime.keyboard.Module.prototype.translate = function $goog$ime$keyboard$Module$$translate$(chars, charsBeforeCaret) {
  if(!this.activeLayout_) {
    return{back:0, chars:""}
  }
  var parsedLayout = this.layouts_[this.activeLayout_];
  if(!parsedLayout) {
    return{back:0, chars:""}
  }
  this.matchHistory_(charsBeforeCaret);
  var result, history = this.historyState_;
  history.ambi && (result = parsedLayout.transform(history.previous.text, history.previous.transat, history.ambi + chars)) && 0 > result.back && (result = null);
  if(result) {
    var prev = history.previous.text, prev = prev.slice(0, prev.length - result.back), prev = prev + result.chars;
    result.back = history.current.text.length;
    result.chars = prev
  }else {
    result = parsedLayout.transform(history.current.text, history.current.transat, chars)
  }
  parsedLayout.isAmbiChars(history.ambi + chars) ? (history.ambi || (history.previous = goog.object.clone(history.current)), history.ambi += chars) : (history.previous.text = "", history.previous.transat = -1, history.ambi = "");
  var text = history.current.text, transat = history.current.transat;
  result ? (text = text.slice(0, text.length - result.back), text += result.chars, transat = text.length) : (text += chars, result = {back:0, chars:chars});
  var maxLen = this.HISTORY_TEXT_LEN_;
  text > maxLen && (transat -= text.length - maxLen, transat = -1 > transat ? -1 : transat, text = text.slice(-maxLen));
  history.current.text = text;
  history.current.transat = transat;
  return result
};
goog.ime.keyboard.Module.prototype.processSpace = function $goog$ime$keyboard$Module$$processSpace$() {
  this.clearHistory_()
};
goog.ime.keyboard.Module.prototype.processBackspace = function $goog$ime$keyboard$Module$$processBackspace$(charsBeforeCaret) {
  this.matchHistory_(charsBeforeCaret);
  var history = this.historyState_, text = history.current.text;
  if(text && history.current.transat < text.length) {
    history.current.text = text.slice(0, text.length - 1);
    if(text = history.ambi) {
      history.ambi = text.slice(0, text.length - 1)
    }
    history.ambi || (history.previous = {text:"", transat:-1})
  }else {
    history.previous = {text:"", transat:-1}, history.ambi = "", history.current = goog.object.clone(history.previous)
  }
};
goog.ime.keyboard.Module.prototype.onLayoutLoaded_ = function $goog$ime$keyboard$Module$$onLayoutLoaded_$(layout) {
  if("hangul" == layout.id) {
    goog.ime.keyboard.Module.loadLayoutScript_("ko")
  }else {
    var parsedLayout = new goog.ime.keyboard.ParsedLayout(layout);
    parsedLayout.id && (this.layouts_[parsedLayout.id] = parsedLayout);
    this.delayActiveLayout_ == layout.id && (this.activateLayout(this.delayActiveLayout_), this.delayActiveLayout_ = "")
  }
};
goog.ime.keyboard.Module.prototype.matchHistory_ = function $goog$ime$keyboard$Module$$matchHistory_$(text) {
  var hisText = this.historyState_.current.text;
  goog.string.endsWith(text, hisText) || this.clearHistory_()
};
goog.ime.keyboard.Module.prototype.clearHistory_ = function $goog$ime$keyboard$Module$$clearHistory_$() {
  this.historyState_.ambi = "";
  this.historyState_.previous = {text:"", transat:-1};
  this.historyState_.current = goog.object.clone(this.historyState_.previous)
};
goog.ime.keyboard.Module.loadLayoutScript_ = function $goog$ime$keyboard$Module$loadLayoutScript_$(layoutCode) {
  var script = goog.dom.createElement("script");
  script.src = goog.ime.keyboard.Module.STATIC_DIR + layoutCode + ".js";
  goog.dom.appendChild(document.body, script)
};
goog.ime.keyboard.Statistics = function $goog$ime$keyboard$Statistics$() {
  this.counters_ = {};
  this.prevVisible_ = !1;
  this.visibleTick_ = this.getCurrentTick_();
  this.wordCounted_ = !1;
  this.wordSeparators_ = {};
  this.imgReferences_ = {};
  this.appName_ = "";
  this.csi_ = window.jstiming && window.jstiming.Timer ? new window.jstiming.Timer : null;
  this.initCounters_();
  this.initWordSeparators_();
  goog.events.listen(window, goog.events.EventType.UNLOAD, this.onPageUnload_, !1, this)
};
goog.ime.keyboard.Statistics.prototype.onPageUnload_ = function $goog$ime$keyboard$Statistics$$onPageUnload_$() {
  this.recordVisible(!1)
};
goog.ime.keyboard.Statistics.prototype.getCurrentTick_ = function $goog$ime$keyboard$Statistics$$getCurrentTick_$() {
  return(new Date).getTime()
};
goog.ime.keyboard.Statistics.CountType = {CLICK:"cc", KEY:"kc", WORD:"wc", SHOWTIME:"st"};
goog.ime.keyboard.Statistics.ENABLE_CSI = !0;
goog.ime.keyboard.Statistics.CSI_NAME_PREFIX_ = "vkd_all,vkd_";
goog.ime.keyboard.Statistics.WORD_SEPARATORS_ = " \u00a0\n\r`~!@#$%^&*()_+-=[]{}\\|;:'\",./<>?";
goog.ime.keyboard.Statistics.PING_URL_ = "//inputtools.google.com/ping?cs=1&app={APP}&itc={CODE}";
goog.ime.keyboard.Statistics.prototype.initCounters_ = function $goog$ime$keyboard$Statistics$$initCounters_$() {
  for(var type in goog.ime.keyboard.Statistics.CountType) {
    this.counters_[goog.ime.keyboard.Statistics.CountType[type]] = 0
  }
};
goog.ime.keyboard.Statistics.prototype.initWordSeparators_ = function $goog$ime$keyboard$Statistics$$initWordSeparators_$() {
  for(var i = 0, c;c = goog.ime.keyboard.Statistics.WORD_SEPARATORS_.charAt(i);++i) {
    this.wordSeparators_[c] = !0
  }
};
goog.ime.keyboard.Statistics.prototype.increaseCount = function $goog$ime$keyboard$Statistics$$increaseCount$(type) {
  this.counters_[type]++
};
goog.ime.keyboard.Statistics.prototype.maybeIncreaseWordCount = function $goog$ime$keyboard$Statistics$$maybeIncreaseWordCount$(text) {
  this.wordSeparators_[text] ? this.wordCounted_ || (this.counters_[goog.ime.keyboard.Statistics.CountType.WORD]++, this.wordCounted_ = !0) : this.wordCounted_ = !1
};
goog.ime.keyboard.Statistics.prototype.recordVisible = function $goog$ime$keyboard$Statistics$$recordVisible$(visible) {
  if(visible != this.prevVisible_) {
    var currentTick = this.getCurrentTick_(), timeSpan = currentTick - this.visibleTick_;
    this.visibleTick_ = currentTick;
    visible || (this.counters_[goog.ime.keyboard.Statistics.CountType.SHOWTIME] += timeSpan, this.report_());
    this.prevVisible_ = visible
  }
};
goog.ime.keyboard.Statistics.prototype.setAppName = function $goog$ime$keyboard$Statistics$$setAppName$(appName) {
  this.appName_ = appName
};
goog.ime.keyboard.Statistics.prototype.setLayout = function $goog$ime$keyboard$Statistics$$setLayout$(layoutCode) {
  this.recordVisible(!1);
  this.csi_ && (this.csi_.name = goog.ime.keyboard.Statistics.CSI_NAME_PREFIX_ + layoutCode.replace(/-/g, "_"));
  if(goog.ime.keyboard.Statistics.ENABLE_CSI) {
    var img = new Image;
    this.imgReferences_[layoutCode] = img;
    img.onload = img.onerror = goog.bind(this.onPingDone_, this, layoutCode);
    img.src = goog.ime.keyboard.Statistics.PING_URL_.replace("{APP}", this.appName_).replace("{CODE}", "vkd_" + layoutCode)
  }
};
goog.ime.keyboard.Statistics.prototype.onPingDone_ = function $goog$ime$keyboard$Statistics$$onPingDone_$(layoutCode) {
  delete this.imgReferences_[layoutCode]
};
goog.ime.keyboard.Statistics.prototype.report_ = function $goog$ime$keyboard$Statistics$$report_$() {
  this.csi_ && this.csi_.name && (goog.ime.keyboard.Statistics.ENABLE_CSI && window.jstiming.report(this.csi_, this.counters_), this.counters_ = {}, this.initCounters_())
};
goog.fx = {};
goog.fx.Dragger = function $goog$fx$Dragger$(target, opt_handle, opt_limits) {
  goog.events.EventTarget.call(this);
  this.target = target;
  this.handle = opt_handle || target;
  this.limits = opt_limits || new goog.math.Rect(NaN, NaN, NaN, NaN);
  this.document_ = goog.dom.getOwnerDocument(target);
  this.eventHandler_ = new goog.events.EventHandler(this);
  goog.events.listen(this.handle, [goog.events.EventType.TOUCHSTART, goog.events.EventType.MOUSEDOWN], this.startDrag, !1, this)
};
goog.inherits(goog.fx.Dragger, goog.events.EventTarget);
goog.fx.Dragger.HAS_SET_CAPTURE_ = goog.userAgent.IE || goog.userAgent.GECKO && goog.userAgent.isVersion("1.9.3");
goog.fx.Dragger.EventType = {EARLY_CANCEL:"earlycancel", START:"start", BEFOREDRAG:"beforedrag", DRAG:"drag", END:"end"};
goog.fx.Dragger.prototype.clientX = 0;
goog.fx.Dragger.prototype.clientY = 0;
goog.fx.Dragger.prototype.screenX = 0;
goog.fx.Dragger.prototype.screenY = 0;
goog.fx.Dragger.prototype.startX = 0;
goog.fx.Dragger.prototype.startY = 0;
goog.fx.Dragger.prototype.deltaX = 0;
goog.fx.Dragger.prototype.deltaY = 0;
goog.fx.Dragger.prototype.enabled_ = !0;
goog.fx.Dragger.prototype.dragging_ = !1;
goog.fx.Dragger.prototype.hysteresisDistanceSquared_ = 0;
goog.fx.Dragger.prototype.ieDragStartCancellingOn_ = !1;
goog.fx.Dragger.prototype.getHandler = function $goog$fx$Dragger$$getHandler$() {
  return this.eventHandler_
};
goog.fx.Dragger.prototype.setLimits = function $goog$fx$Dragger$$setLimits$(limits) {
  this.limits = limits || new goog.math.Rect(NaN, NaN, NaN, NaN)
};
goog.fx.Dragger.prototype.getEnabled = function $goog$fx$Dragger$$getEnabled$() {
  return this.enabled_
};
goog.fx.Dragger.prototype.setEnabled = function $goog$fx$Dragger$$setEnabled$(enabled) {
  this.enabled_ = enabled
};
goog.fx.Dragger.prototype.disposeInternal = function $goog$fx$Dragger$$disposeInternal$() {
  goog.fx.Dragger.superClass_.disposeInternal.call(this);
  goog.events.unlisten(this.handle, [goog.events.EventType.TOUCHSTART, goog.events.EventType.MOUSEDOWN], this.startDrag, !1, this);
  this.eventHandler_.dispose();
  delete this.target;
  delete this.handle;
  delete this.eventHandler_
};
goog.fx.Dragger.prototype.startDrag = function $goog$fx$Dragger$$startDrag$(e) {
  var isMouseDown = e.type == goog.events.EventType.MOUSEDOWN;
  if(this.enabled_ && !this.dragging_ && (!isMouseDown || e.isMouseActionButton())) {
    this.maybeReinitTouchEvent_(e);
    if(0 == this.hysteresisDistanceSquared_) {
      if(this.initializeDrag_(e), this.dragging_) {
        e.preventDefault()
      }else {
        return
      }
    }else {
      e.preventDefault()
    }
    this.setupDragHandlers();
    this.clientX = this.startX = e.clientX;
    this.clientY = this.startY = e.clientY;
    this.screenX = e.screenX;
    this.screenY = e.screenY;
    this.deltaX = goog.style.bidi.getOffsetStart(this.target);
    this.deltaY = this.target.offsetTop;
    this.pageScroll = goog.dom.getDomHelper(this.document_).getDocumentScroll();
    goog.now()
  }else {
    this.dispatchEvent(goog.fx.Dragger.EventType.EARLY_CANCEL)
  }
};
goog.fx.Dragger.prototype.setupDragHandlers = function $goog$fx$Dragger$$setupDragHandlers$() {
  var doc = this.document_, docEl = doc.documentElement, useCapture = !goog.fx.Dragger.HAS_SET_CAPTURE_;
  this.eventHandler_.listen(doc, [goog.events.EventType.TOUCHMOVE, goog.events.EventType.MOUSEMOVE], this.handleMove_, useCapture);
  this.eventHandler_.listen(doc, [goog.events.EventType.TOUCHEND, goog.events.EventType.MOUSEUP], this.endDrag, useCapture);
  goog.fx.Dragger.HAS_SET_CAPTURE_ ? (docEl.setCapture(!1), this.eventHandler_.listen(docEl, goog.events.EventType.LOSECAPTURE, this.endDrag)) : this.eventHandler_.listen(goog.dom.getWindow(doc), goog.events.EventType.BLUR, this.endDrag);
  goog.userAgent.IE && this.ieDragStartCancellingOn_ && this.eventHandler_.listen(doc, goog.events.EventType.DRAGSTART, goog.events.Event.preventDefault);
  this.scrollTarget_ && this.eventHandler_.listen(this.scrollTarget_, goog.events.EventType.SCROLL, this.onScroll_, useCapture)
};
goog.fx.Dragger.prototype.initializeDrag_ = function $goog$fx$Dragger$$initializeDrag_$(e) {
  var rv = this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.START, this, e.clientX, e.clientY, e));
  !1 !== rv && (this.dragging_ = !0)
};
goog.fx.Dragger.prototype.endDrag = function $goog$fx$Dragger$$endDrag$(e, opt_dragCanceled) {
  this.eventHandler_.removeAll();
  goog.fx.Dragger.HAS_SET_CAPTURE_ && this.document_.releaseCapture();
  var x = this.limitX(this.deltaX), y = this.limitY(this.deltaY);
  if(this.dragging_) {
    this.maybeReinitTouchEvent_(e);
    this.dragging_ = !1;
    var dragCancelled = opt_dragCanceled || e.type == goog.events.EventType.TOUCHCANCEL;
    this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.END, this, e.clientX, e.clientY, e, x, y, dragCancelled))
  }else {
    this.dispatchEvent(goog.fx.Dragger.EventType.EARLY_CANCEL)
  }
  (e.type == goog.events.EventType.TOUCHEND || e.type == goog.events.EventType.TOUCHCANCEL) && e.preventDefault()
};
goog.fx.Dragger.prototype.maybeReinitTouchEvent_ = function $goog$fx$Dragger$$maybeReinitTouchEvent_$(e) {
  var type = e.type;
  type == goog.events.EventType.TOUCHSTART || type == goog.events.EventType.TOUCHMOVE ? e.init(e.getBrowserEvent().targetTouches[0], e.currentTarget) : (type == goog.events.EventType.TOUCHEND || type == goog.events.EventType.TOUCHCANCEL) && e.init(e.getBrowserEvent().changedTouches[0], e.currentTarget)
};
goog.fx.Dragger.prototype.handleMove_ = function $goog$fx$Dragger$$handleMove_$(e) {
  if(this.enabled_) {
    this.maybeReinitTouchEvent_(e);
    var sign = goog.style.isRightToLeft(this.target) ? -1 : 1, dx = sign * (e.clientX - this.clientX), dy = e.clientY - this.clientY;
    this.clientX = e.clientX;
    this.clientY = e.clientY;
    this.screenX = e.screenX;
    this.screenY = e.screenY;
    if(!this.dragging_) {
      var diffX = this.startX - this.clientX, diffY = this.startY - this.clientY, distance = diffX * diffX + diffY * diffY;
      if(distance > this.hysteresisDistanceSquared_ && (this.initializeDrag_(e), !this.dragging_)) {
        this.endDrag(e);
        return
      }
    }
    var pos = this.calculatePosition_(dx, dy), x = pos.x, y = pos.y;
    if(this.dragging_) {
      var rv = this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.BEFOREDRAG, this, e.clientX, e.clientY, e, x, y));
      !1 !== rv && (this.doDrag(e, x, y, !1), e.preventDefault())
    }
  }
};
goog.fx.Dragger.prototype.calculatePosition_ = function $goog$fx$Dragger$$calculatePosition_$(dx, dy) {
  var pageScroll = goog.dom.getDomHelper(this.document_).getDocumentScroll(), dx = dx + (pageScroll.x - this.pageScroll.x), dy = dy + (pageScroll.y - this.pageScroll.y);
  this.pageScroll = pageScroll;
  this.deltaX += dx;
  this.deltaY += dy;
  var x = this.limitX(this.deltaX), y = this.limitY(this.deltaY);
  return new goog.math.Coordinate(x, y)
};
goog.fx.Dragger.prototype.onScroll_ = function $goog$fx$Dragger$$onScroll_$(e) {
  var pos = this.calculatePosition_(0, 0);
  e.clientX = this.clientX;
  e.clientY = this.clientY;
  this.doDrag(e, pos.x, pos.y, !0)
};
goog.fx.Dragger.prototype.doDrag = function $goog$fx$Dragger$$doDrag$(e, x, y) {
  this.defaultAction(x, y);
  this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.DRAG, this, e.clientX, e.clientY, e, x, y))
};
goog.fx.Dragger.prototype.limitX = function $goog$fx$Dragger$$limitX$(x) {
  var rect = this.limits, left = !isNaN(rect.left) ? rect.left : null, width = !isNaN(rect.width) ? rect.width : 0, maxX = null != left ? left + width : Infinity, minX = null != left ? left : -Infinity;
  return Math.min(maxX, Math.max(minX, x))
};
goog.fx.Dragger.prototype.limitY = function $goog$fx$Dragger$$limitY$(y) {
  var rect = this.limits, top = !isNaN(rect.top) ? rect.top : null, height = !isNaN(rect.height) ? rect.height : 0, maxY = null != top ? top + height : Infinity, minY = null != top ? top : -Infinity;
  return Math.min(maxY, Math.max(minY, y))
};
goog.fx.Dragger.prototype.defaultAction = function $goog$fx$Dragger$$defaultAction$(x, y) {
  goog.style.isRightToLeft(this.target) ? this.target.style.right = x + "px" : this.target.style.left = x + "px";
  this.target.style.top = y + "px"
};
goog.fx.DragEvent = function $goog$fx$DragEvent$(type, dragobj, clientX, clientY, browserEvent, opt_actX, opt_actY) {
  goog.events.Event.call(this, type);
  this.clientX = clientX;
  this.clientY = clientY;
  this.left = goog.isDef(opt_actX) ? opt_actX : dragobj.deltaX;
  this.top = goog.isDef(opt_actY) ? opt_actY : dragobj.deltaY
};
goog.inherits(goog.fx.DragEvent, goog.events.Event);
goog.ime.keyboard.View = function $goog$ime$keyboard$View$(view, domHelper) {
  this.dragger_ = null;
  this.view_ = view;
  this.state_ = "";
  this.buttons_ = {};
  this.hoverBtn_ = this.activeBtn_ = this.contentPanel_ = this.closeBtn_ = this.titleBar_ = null;
  this.BTN_WIDTH_ = 33;
  this.DRAG_PADDING_ = this.BTN_MARGIN_ = 2;
  goog.ui.Component.call(this, domHelper)
};
goog.inherits(goog.ime.keyboard.View, goog.ui.Component);
goog.ime.keyboard.View.BTN_IMG_DIR = "//ssl.gstatic.com/inputtools/images/vk/layouts/";
goog.ime.keyboard.View.HELP_URL = "";
goog.ime.keyboard.View.VISUALIZE_CLICK_BUTTON_LAG_ = 250;
goog.ime.keyboard.View.prototype.createDom = function $goog$ime$keyboard$View$$createDom$() {
  goog.ime.keyboard.View.superClass_.createDom.call(this);
  var container = this.getElement();
  container.id = "kbd";
  container.dir = "ltr";
  container.className = goog.userAgent.IE ? "vk-box vk-sf-ie" : "vk-box";
  container.style.width = 15 * this.BTN_WIDTH_ + "px";
  var titleBar = this.buildTitleBar_();
  this.contentPanel_ = this.buildContentPane_();
  var table = this.buildTable_(2, 1);
  goog.dom.appendChild(table.rows[0].cells[0], titleBar);
  goog.dom.appendChild(table.rows[1].cells[0], this.contentPanel_);
  goog.dom.appendChild(container, table)
};
goog.ime.keyboard.View.prototype.enterDocument = function $goog$ime$keyboard$View$$enterDocument$() {
  goog.ime.keyboard.View.superClass_.enterDocument.call(this);
  this.dragger_ = new goog.fx.Dragger(this.getElement(), this.titleBar_);
  this.onResize_();
  goog.events.listen(window, goog.events.EventType.RESIZE, this.onResize_, !1, this);
  var redirectFocusHandler = function $redirectFocusHandler$(e) {
    this.dispatchEvent(new goog.events.Event(goog.ui.Component.EventType.ACTION, {keyCode:0}));
    e.preventDefault();
    return!0
  }, eventsForUnfocusable = [goog.events.EventType.FOCUS, goog.events.EventType.MOUSEDOWN, goog.events.EventType.MOUSEUP, goog.events.EventType.CLICK], eventsForButtonUI = [goog.events.EventType.MOUSEDOWN, goog.events.EventType.MOUSEOVER, goog.events.EventType.MOUSEOUT], code;
  for(code in this.buttons_) {
    var button = this.buttons_[code];
    code = parseInt(code, 10);
    goog.isArrayLike(button) || (button = [button]);
    for(var i = 0, btn;btn = button[i];++i) {
      goog.events.listen(btn, goog.events.EventType.CLICK, goog.bind(this.onButtonClick_, this, code)), goog.events.listen(btn, eventsForButtonUI, goog.bind(this.onButtonMouseEvents_, this, btn))
    }
  }
  goog.events.listen(this.getDomHelper().getDocument(), goog.events.EventType.MOUSEUP, goog.bind(this.onButtonMouseEvents_, this, null));
  goog.events.listen(this.contentPanel_, eventsForUnfocusable, redirectFocusHandler, !1, this);
  goog.events.listen(this.closeBtn_, goog.array.concat(eventsForButtonUI, goog.events.EventType.CLICK), this.onCloseButtonMouseEvents_, !1, this)
};
goog.ime.keyboard.View.prototype.exitDocument = function $goog$ime$keyboard$View$$exitDocument$() {
  goog.ime.keyboard.View.superClass_.exitDocument.call(this);
  this.dragger_ && (this.dragger_.dispose(), this.dragger_ = null);
  goog.events.removeAll(this.closeBtn_);
  goog.events.removeAll(this.contentPanel_);
  for(var code in this.buttons_) {
    var button = this.buttons_[code];
    goog.events.removeAll(button)
  }
  goog.events.unlisten(window, goog.events.EventType.RESIZE, this.onResize_, !1, this)
};
goog.ime.keyboard.View.prototype.onButtonClick_ = function $goog$ime$keyboard$View$$onButtonClick_$(code) {
  this.dispatchEvent(new goog.events.Event(goog.ui.Component.EventType.ACTION, {keyCode:code}))
};
goog.ime.keyboard.View.prototype.onButtonMouseEvents_ = function $goog$ime$keyboard$View$$onButtonMouseEvents_$(btn, e) {
  var isActive = !1, isSelected = !1;
  btn && (isActive = goog.dom.classes.has(btn, "vk-sf-a"), isSelected = goog.dom.classes.has(btn, "vk-sf-s"));
  switch(e.type) {
    case goog.events.EventType.MOUSEOVER:
      this.hoverBtn_ = btn;
      !isActive && !isSelected && (goog.dom.classes.set(btn, "vk-btn vk-sf-h"), goog.dom.classes.add(btn.firstChild, "vk-sf-h"));
      break;
    case goog.events.EventType.MOUSEOUT:
      this.hoverBtn_ = null;
      !isActive && !isSelected && (goog.dom.classes.set(btn, "vk-btn"), goog.dom.classes.remove(btn.firstChild, "vk-sf-h"));
      break;
    case goog.events.EventType.MOUSEDOWN:
      isSelected || (goog.dom.classes.set(btn, "vk-btn vk-sf-a"), this.activeBtn_ = btn);
      break;
    case goog.events.EventType.MOUSEUP:
      if(this.activeBtn_ && (goog.dom.classes.set(this.activeBtn_, "vk-btn"), goog.dom.classes.remove(this.activeBtn_.firstChild, "vk-sf-h"), this.activeBtn_ = null), this.hoverBtn_) {
        goog.dom.classes.set(this.hoverBtn_, "vk-btn vk-sf-h"), goog.dom.classes.add(this.hoverBtn_.firstChild, "vk-sf-h")
      }
  }
};
goog.ime.keyboard.View.prototype.onCloseButtonMouseEvents_ = function $goog$ime$keyboard$View$$onCloseButtonMouseEvents_$(e) {
  switch(e.type) {
    case goog.events.EventType.CLICK:
      this.dispatchEvent(new goog.events.Event(goog.ui.Component.EventType.CLOSE));
      break;
    case goog.events.EventType.MOUSEOVER:
      goog.dom.classes.add(this.closeBtn_.firstChild, "vk-sf-th");
      break;
    case goog.events.EventType.MOUSEOUT:
      goog.dom.classes.remove(this.closeBtn_.firstChild, "vk-sf-th")
  }
};
goog.ime.keyboard.View.prototype.onResize_ = function $goog$ime$keyboard$View$$onResize_$() {
  var padding = this.DRAG_PADDING_, container = this.getElement(), size = goog.style.getSize(container), bound = goog.dom.getViewportSize();
  bound.width -= size.width + padding;
  bound.height -= size.height + padding;
  this.dragger_.setLimits(new goog.math.Rect(padding, padding, bound.width, bound.height));
  var pos = goog.style.getClientPosition(container);
  pos.x > bound.width && (container.style.left = bound.width + "px");
  pos.y > bound.height && (container.style.top = bound.height + "px");
  pos = goog.style.getClientPosition(container);
  pos.x < padding && (container.style.left = padding + "px");
  pos.y < padding && (container.style.top = padding + "px")
};
goog.ime.keyboard.View.prototype.getCommitChars = function $goog$ime$keyboard$View$$getCommitChars$(keyCode) {
  var keyChar = String.fromCharCode(keyCode), item = this.view_[this.state_][keyChar];
  if(item) {
    var chars = item[2];
    if(chars) {
      return chars
    }
  }
  var codes = this.view_.is102 ? goog.ime.keyboard.KeyCode.CODES102 : goog.ime.keyboard.KeyCode.CODES101;
  return 0 <= codes.indexOf(keyChar) && keyCode != goog.events.KeyCodes.SPACE ? "" : null
};
goog.ime.keyboard.View.prototype.reposition = function $goog$ime$keyboard$View$$reposition$(pos) {
  var container = this.getElement();
  if(container) {
    var bound = goog.dom.getDomHelper(container).getViewportSize();
    bound.width -= this.DRAG_PADDING_;
    bound.height -= this.DRAG_PADDING_;
    if(pos) {
      pos.x = Math.max(pos.x, this.DRAG_PADDING_), pos.y = Math.max(pos.y, this.DRAG_PADDING_), pos.x = Math.min(pos.x, bound.width), pos.y = Math.min(pos.y, bound.height)
    }else {
      var containerSize = goog.style.getSize(container), pos = new goog.math.Coordinate(this.isRTL() ? this.DRAG_PADDING_ : bound.width - containerSize.width, bound.height - containerSize.height)
    }
    goog.style.setPosition(container, pos)
  }
};
goog.ime.keyboard.View.prototype.getPosition = function $goog$ime$keyboard$View$$getPosition$() {
  var pos = goog.style.getPosition(this.getElement());
  return pos
};
goog.ime.keyboard.View.prototype.refreshState = function $goog$ime$keyboard$View$$refreshState$(state) {
  if(this.view_) {
    this.view_[state] && (this.state_ = state);
    var ss = {20:"l", 16:"s", 273:"c"}, code;
    for(code in this.buttons_) {
      var button = this.buttons_[code];
      code = parseInt(code, 10);
      var s = ss[code];
      if(s) {
        goog.isArrayLike(button) || (button = [button]);
        for(var i = 0, btn;btn = button[i];++i) {
          btn.className = 0 <= state.indexOf(s) ? "vk-btn vk-sf-s" : "vk-btn"
        }
      }else {
        var caption = this.buildCaption_(code);
        caption && (goog.dom.removeChildren(button), goog.dom.appendChild(button, caption))
      }
    }
    this.hoverBtn_ && !goog.dom.classes.has(this.hoverBtn_, "vk-sf-s") && (goog.dom.classes.set(this.hoverBtn_, "vk-btn vk-sf-h"), goog.dom.classes.add(this.hoverBtn_.firstChild, "vk-sf-h"))
  }
};
goog.ime.keyboard.View.prototype.setVisible = function $goog$ime$keyboard$View$$setVisible$(showOrHide) {
  var container = this.getElement();
  showOrHide ? "visible" != container.style.visibility && (container.style.visibility = "visible") : "hidden" != container.style.visibility && (container.style.visibility = "hidden")
};
goog.ime.keyboard.View.prototype.visualizeClickButton = function $goog$ime$keyboard$View$$visualizeClickButton$(keyCode) {
  var button = this.buttons_[keyCode];
  button && (button.className = "vk-btn vk-sf-a", window.setTimeout(function() {
    button.className = "vk-btn"
  }, goog.ime.keyboard.View.VISUALIZE_CLICK_BUTTON_LAG_))
};
goog.ime.keyboard.View.prototype.isRTL = function $goog$ime$keyboard$View$$isRTL$() {
  return this.view_.isRTL
};
goog.ime.keyboard.View.prototype.buildTable_ = function $goog$ime$keyboard$View$$buildTable_$(rows, cols) {
  var table = goog.dom.createTable(rows, cols);
  table.cellPadding = "0";
  table.cellSpacing = "0";
  table.border = "0";
  table.width = "100%";
  for(var i = 0;i < rows;++i) {
    for(var j = 0;j < cols;++j) {
      var cell = table.rows[i].cells[j];
      cell.style.padding = cell.style.margin = "0px";
      cell.style.border = "0 none"
    }
  }
  return table
};
goog.ime.keyboard.View.prototype.buildTitleBar_ = function $goog$ime$keyboard$View$$buildTitleBar_$() {
  var hasHelpBtn = !!goog.ime.keyboard.View.HELP_URL, ret = goog.dom.createDom(goog.dom.TagName.DIV, {width:"100%", dir:this.view_.isRTL ? "rtl" : "ltr"});
  this.titleBar_ = goog.dom.createDom(goog.dom.TagName.DIV, {"class":"vk-t"}, this.view_.title);
  this.titleBar_.style.textAlign = this.view_.isRTL ? "right" : "left";
  goog.dom.appendChild(ret, this.titleBar_);
  this.closeBtn_ = goog.dom.createDom(goog.dom.TagName.DIV, {"class":"vk-t-btn-o vk-sf-cl"});
  goog.dom.classes.add(this.closeBtn_, this.view_.isRTL ? "vk-sf-rtl" : "vk-sf-ltr");
  goog.dom.appendChild(this.closeBtn_, goog.dom.createDom(goog.dom.TagName.DIV, {"class":"vk-t-btn vk-sf-cl"}));
  goog.dom.appendChild(ret, this.closeBtn_);
  if(hasHelpBtn) {
    var helpBtn = goog.dom.createDom(goog.dom.TagName.A, {target:"_blank", href:goog.ime.keyboard.View.HELP_URL, "class":"vk-t-btn-o vk-sf-hp"});
    goog.dom.classes.add(helpBtn, this.view_.isRTL ? "vk-sf-rtl" : "vk-sf-ltr");
    goog.dom.appendChild(helpBtn, goog.dom.createDom(goog.dom.TagName.DIV, {"class":"vk-t-btn vk-sf-hp"}));
    goog.dom.appendChild(ret, helpBtn)
  }
  return ret
};
goog.ime.keyboard.View.prototype.buildContentPane_ = function $goog$ime$keyboard$View$$buildContentPane_$() {
  for(var buttonCounts = [14, 14, this.view_.is102 ? 14 : 13, this.view_.is102 ? 13 : 12, 3], buttonScales = this.view_.is102 ? [{13:2}, {"0":1.5, 13:1.5}, {"0":1.75, 13:1.25}, {"0":1.25, 12:2.75}, {"0":3, 1:9, 2:3}] : [{13:2}, {"0":1.5, 13:1.5}, {"0":1.75, 12:2.25}, {"0":2.25, 11:2.75}, {"0":3, 1:9, 2:3}], codes = this.view_.is102 ? goog.ime.keyboard.KeyCode.ALLCODES102 : goog.ime.keyboard.KeyCode.ALLCODES101, codeIndex = 0, table = this.buildTable_(5, 1), i = 0;5 > i;++i) {
    for(var tableRow = this.buildTable_(1, buttonCounts[i]), j = 0;j < buttonCounts[i];++j) {
      var code = codes.charCodeAt(codeIndex++), scale = buttonScales[i][j];
      scale || (scale = 1);
      var button = this.buildButton_(code, scale);
      goog.dom.appendChild(tableRow.rows[0].cells[j], button)
    }
    goog.dom.appendChild(table.rows[i].cells[0], tableRow)
  }
  return table
};
goog.ime.keyboard.View.prototype.buildButton_ = function $goog$ime$keyboard$View$$buildButton_$(code, scale) {
  var buttonWidth = this.BTN_WIDTH_ * scale - 2 * this.BTN_MARGIN_, buttonHeight = this.BTN_WIDTH_ - 2 * this.BTN_MARGIN_, caption = this.buildCaption_(code), button = goog.dom.createDom(goog.dom.TagName.BUTTON, {id:"K" + code, type:"button", "class":"vk-btn", style:"margin:" + this.BTN_MARGIN_ + "px;width:" + buttonWidth + "px;height:" + buttonHeight + "px;visibility:" + (caption ? "" : "hidden")});
  caption && goog.dom.appendChild(button, caption);
  this.buttons_[code] = this.buttons_[code] ? [this.buttons_[code], button] : button;
  return button
};
goog.ime.keyboard.View.prototype.buildCaption_ = function $goog$ime$keyboard$View$$buildCaption_$(code) {
  var codes = goog.events.KeyCodes;
  if(code == codes.TAB || code == codes.ENTER) {
    return null
  }
  var caption = goog.dom.createDom(goog.dom.TagName.SPAN);
  if(goog.array.contains([codes.SHIFT, codes.CAPS_LOCK, codes.BACKSPACE], code)) {
    return caption.className = "vk-cap vk-sf-b vk-sf-c" + code, caption
  }
  if(273 == code) {
    return caption.className = "vk-cap vk-sf-c" + code, caption.innerHTML = "Ctrl + Alt", caption
  }
  var child = null, disp = this.view_[this.state_][String.fromCharCode(code)];
  disp && disp[1] && ("S" == disp[0] ? (child = goog.dom.createTextNode(disp[1]), caption.className = "vk-cap") : "P" == disp[0] && (child = goog.dom.createDom(goog.dom.TagName.IMG, {src:goog.ime.keyboard.View.BTN_IMG_DIR + this.view_.id + "_" + disp[1] + ".png"}), child.className = "vk-cap-i"));
  child ? goog.dom.appendChild(caption, child) : (goog.dom.appendChild(caption, goog.dom.createTextNode(".")), caption.style.visibility = "hidden");
  return caption
};
goog.ime.keyboard.EventType = {KEYBOARD_CLOSED:"kc"};
goog.ime.keyboard.Controller = function $goog$ime$keyboard$Controller$() {
  this.module_ = new goog.ime.keyboard.Module(goog.bind(this.onLayoutActivated_, this));
  this.statistics_ = new goog.ime.keyboard.Statistics;
  this.inputable_ = null;
  this.domHelper_ = goog.dom.getDomHelper();
  this.listening_ = !0;
  this.state_ = 0;
  this.activeView_ = null;
  this.keyDownResults_ = {};
  this.oemId_ = "en";
  this.position_ = null;
  this.visible_ = !0;
  this.eventTarget_ = new goog.events.EventTarget;
  goog.ime.keyboard.Controller.Css && (goog.style.installStyles(goog.ime.keyboard.Controller.Css), goog.ime.keyboard.Controller.Css = "")
};
goog.ime.keyboard.Controller.Css = "";
goog.ime.keyboard.Controller.StateBit = {SHIFT:1, ALT:2, CTRL:4, CAPS:8, META:16, SHIFT_CLICK:256, ALTGR_CLICK:512};
goog.ime.keyboard.Controller.getInstance = function $goog$ime$keyboard$Controller$getInstance$() {
  goog.ime.keyboard.Controller.INSTANCE || (goog.ime.keyboard.Controller.INSTANCE = new goog.ime.keyboard.Controller);
  return goog.ime.keyboard.Controller.INSTANCE
};
goog.ime.keyboard.Controller.prototype.setInputable = function $goog$ime$keyboard$Controller$$setInputable$(inputable) {
  this.inputable_ = inputable
};
goog.ime.keyboard.Controller.prototype.setDomHelper = function $goog$ime$keyboard$Controller$$setDomHelper$(domHelper) {
  this.domHelper_ = domHelper
};
goog.ime.keyboard.Controller.prototype.setAppName = function $goog$ime$keyboard$Controller$$setAppName$(appName) {
  this.statistics_.setAppName(appName)
};
goog.ime.keyboard.Controller.prototype.loadLayout = function $goog$ime$keyboard$Controller$$loadLayout$(layoutCode) {
  this.module_.loadLayout(layoutCode)
};
goog.ime.keyboard.Controller.prototype.activateLayout = function $goog$ime$keyboard$Controller$$activateLayout$(layoutCode) {
  this.module_.activateLayout(layoutCode)
};
goog.ime.keyboard.Controller.prototype.setVisible = function $goog$ime$keyboard$Controller$$setVisible$(visible) {
  this.visible_ = visible;
  this.activeView_ && (this.activeView_.setVisible(visible), this.listening_ = visible, this.statistics_.recordVisible(visible))
};
goog.ime.keyboard.Controller.prototype.reposition = function $goog$ime$keyboard$Controller$$reposition$(left, top) {
  var pos = new goog.math.Coordinate(left, top);
  this.activeView_ ? this.activeView_.reposition(pos) : this.position_ = pos
};
goog.ime.keyboard.Controller.prototype.addEventListener = function $goog$ime$keyboard$Controller$$addEventListener$(type, listener, opt_scope) {
  this.eventTarget_.addEventListener(type, listener, !1, opt_scope)
};
goog.ime.keyboard.Controller.prototype.getDirection = function $goog$ime$keyboard$Controller$$getDirection$() {
  return this.activeView_ && this.activeView_.isRTL() ? "rtl" : "ltr"
};
goog.ime.keyboard.Controller.prototype.handleEvent = function $goog$ime$keyboard$Controller$$handleEvent$(e) {
  if(!this.listening_ || !this.activeView_) {
    return!1
  }
  var ret = !1;
  switch(e.type) {
    case goog.events.EventType.KEYDOWN:
      ret = this.onKeyDown_(e);
      break;
    case goog.events.EventType.KEYPRESS:
      ret = this.onKeyPress_(e);
      break;
    case goog.events.EventType.KEYUP:
      ret = this.onKeyUp_(e)
  }
  return ret
};
goog.ime.keyboard.Controller.prototype.onCloseButtonClick_ = function $goog$ime$keyboard$Controller$$onCloseButtonClick_$() {
  this.setVisible(!1);
  this.eventTarget_.dispatchEvent(new goog.events.Event(goog.ime.keyboard.EventType.KEYBOARD_CLOSED))
};
goog.ime.keyboard.Controller.prototype.onButtonClick_ = function $goog$ime$keyboard$Controller$$onButtonClick_$(e) {
  if(this.activeView_) {
    this.inputable_ && this.inputable_.setFocus();
    var keyCode = e.target.keyCode;
    if(keyCode) {
      var codes = goog.events.KeyCodes, states = goog.ime.keyboard.Controller.StateBit;
      switch(keyCode) {
        case codes.SHIFT:
          this.state_ ^= states.SHIFT_CLICK;
          this.activeView_.refreshState(this.getUiState_());
          break;
        case 273:
          this.state_ ^= states.ALTGR_CLICK;
          this.activeView_.refreshState(this.getUiState_());
          break;
        case codes.CAPS_LOCK:
          this.state_ ^= states.CAPS;
          this.activeView_.refreshState(this.getUiState_());
          break;
        default:
          this.commitChars_(keyCode)
      }
      this.statistics_.increaseCount(goog.ime.keyboard.Statistics.CountType.CLICK)
    }
  }
};
goog.ime.keyboard.Controller.prototype.onLayoutActivated_ = function $goog$ime$keyboard$Controller$$onLayoutActivated_$(view) {
  var pos = this.position_ ? this.position_ : null;
  this.position_ = null;
  this.activeView_ && (pos = pos ? pos : this.activeView_.getPosition(), this.activeView_.dispose());
  this.statistics_.setLayout(view.id);
  this.activeView_ = new goog.ime.keyboard.View(view, this.domHelper_);
  this.activeView_.render();
  this.activeView_.reposition(pos);
  this.activeView_.refreshState(this.getUiState_());
  this.setVisible(this.visible_);
  this.activeView_.addEventListener(goog.ui.Component.EventType.ACTION, goog.bind(this.onButtonClick_, this));
  this.activeView_.addEventListener(goog.ui.Component.EventType.CLOSE, goog.bind(this.onCloseButtonClick_, this))
};
goog.ime.keyboard.Controller.prototype.onKeyDown_ = function $goog$ime$keyboard$Controller$$onKeyDown_$(e) {
  var codes = goog.events.KeyCodes, states = goog.ime.keyboard.Controller.StateBit, code = this.normalizeKeyCode_(e.keyCode);
  this.updateState_(code, e);
  if(this.state_ & states.META) {
    return this.keyDownReturn_(code, !1)
  }
  var shift = !!(this.state_ & states.SHIFT), ctrl = !!(this.state_ & states.CTRL), alt = !!(this.state_ & states.ALT), meta = !!(this.state_ & states.META);
  if(code == codes.CTRL || code == codes.ALT || code == codes.SHIFT || code == codes.CAPS_LOCK) {
    return this.keyDownReturn_(code, shift || ctrl == alt)
  }
  if(meta || !shift && ctrl != alt) {
    return this.keyDownReturn_(code, this.onHotKey_(code))
  }
  this.statistics_.increaseCount(goog.ime.keyboard.Statistics.CountType.KEY);
  this.activeView_.visualizeClickButton(code);
  return this.keyDownReturn_(code, this.commitChars_(code))
};
goog.ime.keyboard.Controller.prototype.onKeyPress_ = function $goog$ime$keyboard$Controller$$onKeyPress_$(e) {
  if(goog.userAgent.MAC && goog.userAgent.GECKO && !this.keyDownResults_[0]) {
    var code = goog.ime.keyboard.KeyCode.MOZ_SHIFT_CHAR_CODES[e.charCode];
    if(code) {
      return this.commitChars_(code)
    }
  }
  return this.keyDownResults_[0]
};
goog.ime.keyboard.Controller.prototype.onKeyUp_ = function $goog$ime$keyboard$Controller$$onKeyUp_$(e) {
  var codes = goog.events.KeyCodes, states = goog.ime.keyboard.Controller.StateBit, code = this.normalizeKeyCode_(e.keyCode);
  code == codes.CAPS_LOCK && goog.userAgent.MAC && goog.userAgent.WEBKIT ? this.state_ &= ~states.CAPS : code == codes.SHIFT ? (this.state_ &= ~states.SHIFT, this.state_ &= ~states.SHIFT_CLICK) : code == codes.ALT ? (this.state_ &= ~states.ALT, this.state_ &= ~states.ALTGR_CLICK) : code == codes.CTRL ? (this.state_ &= ~states.CTRL, this.state_ &= ~states.ALTGR_CLICK) : code == codes.META && (this.state_ &= ~states.META);
  this.activeView_.refreshState(this.getUiState_());
  var ret = this.keyDownResults_[code];
  delete this.keyDownResults_[code];
  return ret
};
goog.ime.keyboard.Controller.prototype.updateState_ = function $goog$ime$keyboard$Controller$$updateState_$(code, e) {
  var codes = goog.events.KeyCodes, states = goog.ime.keyboard.Controller.StateBit, state = this.state_ & (states.CAPS | states.SHIFT_CLICK | states.ALTGR_CLICK);
  code == codes.CAPS_LOCK && (state = !goog.userAgent.MAC || !goog.userAgent.WEBKIT ? state ^ states.CAPS : state | states.CAPS);
  if(code == codes.SHIFT || e.shiftKey) {
    state |= states.SHIFT
  }
  if(code == codes.ALT || e.altKey) {
    state |= states.ALT
  }
  if(code == codes.CTRL || e.ctrlKey) {
    state |= states.CTRL
  }
  if(code == codes.META || e.metaKey) {
    state |= states.META
  }
  this.state_ = state;
  this.activeView_.refreshState(this.getUiState_())
};
goog.ime.keyboard.Controller.prototype.keyDownReturn_ = function $goog$ime$keyboard$Controller$$keyDownReturn_$(code, ret) {
  return this.keyDownResults_[0] = this.keyDownResults_[code] = ret
};
goog.ime.keyboard.Controller.prototype.commitChars_ = function $goog$ime$keyboard$Controller$$commitChars_$(keyCode) {
  var codes = goog.events.KeyCodes, states = goog.ime.keyboard.Controller.StateBit;
  if(!this.inputable_) {
    return!1
  }
  var text = this.inputable_.getTextBeforeCaret(20);
  text || (text = "");
  var trans = null, chars = this.activeView_.getCommitChars(keyCode);
  chars ? this.statistics_.maybeIncreaseWordCount(chars) : keyCode != codes.BACKSPACE && (65 > keyCode || 90 < keyCode) && (48 > keyCode || 57 < keyCode) && this.statistics_.maybeIncreaseWordCount(" ");
  if(this.state_ & states.SHIFT_CLICK || this.state_ & states.ALTGR_CLICK) {
    this.state_ &= ~states.SHIFT_CLICK, this.state_ &= ~states.ALTGR_CLICK, this.activeView_.refreshState(this.getUiState_())
  }
  if("" == chars) {
    return!0
  }
  if(null == chars) {
    if(keyCode == codes.BACKSPACE) {
      this.module_.processBackspace(text), trans = {back:1, chars:""}
    }else {
      if(keyCode == codes.SPACE) {
        this.module_.processSpace(), trans = {back:0, chars:" "}
      }else {
        return!1
      }
    }
  }
  trans || (trans = this.module_.translate(chars ? chars : "", text));
  this.inputable_.commitText(trans.chars, trans.back);
  return!0
};
goog.ime.keyboard.Controller.prototype.normalizeKeyCode_ = function $goog$ime$keyboard$Controller$$normalizeKeyCode_$(keyCode) {
  var code = keyCode, codes = goog.events.KeyCodes;
  if(goog.userAgent.LINUX && (code == codes.META && goog.userAgent.WEBKIT || code == codes.MAC_FF_META && goog.userAgent.GECKO)) {
    code = codes.ALT
  }
  var code = goog.ime.keyboard.KeyCode.MOZ_CODES[code] || code, keyMap = goog.ime.keyboard.KeyCode.OEM_CODES[this.oemId_];
  keyMap && (code = keyMap[String.fromCharCode(code)] || code);
  return code
};
goog.ime.keyboard.Controller.prototype.onHotKey_ = function $goog$ime$keyboard$Controller$$onHotKey_$() {
  return!1
};
goog.ime.keyboard.Controller.prototype.getUiState_ = function $goog$ime$keyboard$Controller$$getUiState_$() {
  var uiState = "", states = goog.ime.keyboard.Controller.StateBit;
  if(this.state_ & states.SHIFT || this.state_ & states.SHIFT_CLICK) {
    uiState += "s"
  }
  if(this.state_ & states.ALT && this.state_ & states.CTRL || this.state_ & states.ALTGR_CLICK) {
    uiState += "c"
  }
  this.state_ & states.CAPS && (uiState += "l");
  return uiState
};
goog.ime.dom = {};
goog.ime.dom.InputType = {RICHEDIT:"re", TEXTEDIT:"te", CUSTOMIZED:"cus"};
goog.ime.net = {};
goog.ime.net.AsyncHttpRequest = function $goog$ime$net$AsyncHttpRequest$(url, payload) {
  this.url = url;
  this.payload = payload
};
goog.ime.net.AsyncHttpService = function $goog$ime$net$AsyncHttpService$() {
};
goog.ime.plugin = {};
goog.ime.plugin.LookupQueryStatus = {SUCCESS:"s", ABORTED:"a", PENDING:"p", INITIALIZED:"i", FAILED:"f"};
goog.ime.plugin.LookupQuery = function $goog$ime$plugin$LookupQuery$(text, opt_isReverse) {
  this.text = goog.isArray(text) ? text : [text];
  this.isReverse = !!opt_isReverse;
  this.status = goog.ime.plugin.LookupQueryStatus.INITIALIZED
};
goog.ime.plugin.LookupQuery.prototype.getText = function $goog$ime$plugin$LookupQuery$$getText$() {
  return this.text[0]
};
goog.ime.plugin.LookupQuery.prototype.isComplete = function $goog$ime$plugin$LookupQuery$$isComplete$() {
  return this.status == goog.ime.plugin.LookupQueryStatus.SUCCESS || this.status == goog.ime.plugin.LookupQueryStatus.FAILED
};
goog.userAgent.jscript = {};
goog.userAgent.jscript.ASSUME_NO_JSCRIPT = !1;
goog.userAgent.jscript.init_ = function $goog$userAgent$jscript$init_$() {
  var hasScriptEngine = "ScriptEngine" in goog.global;
  goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_ = hasScriptEngine && "JScript" == goog.global.ScriptEngine();
  goog.userAgent.jscript.DETECTED_VERSION_ = goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_ ? goog.global.ScriptEngineMajorVersion() + "." + goog.global.ScriptEngineMinorVersion() + "." + goog.global.ScriptEngineBuildVersion() : "0"
};
goog.userAgent.jscript.ASSUME_NO_JSCRIPT || goog.userAgent.jscript.init_();
goog.userAgent.jscript.HAS_JSCRIPT = goog.userAgent.jscript.ASSUME_NO_JSCRIPT ? !1 : goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_;
goog.userAgent.jscript.VERSION = goog.userAgent.jscript.ASSUME_NO_JSCRIPT ? "0" : goog.userAgent.jscript.DETECTED_VERSION_;
goog.userAgent.jscript.isVersion = function $goog$userAgent$jscript$isVersion$(version) {
  return 0 <= goog.string.compareVersions(goog.userAgent.jscript.VERSION, version)
};
goog.string.StringBuffer = function $goog$string$StringBuffer$(opt_a1, var_args) {
  this.buffer_ = goog.userAgent.jscript.HAS_JSCRIPT ? [] : "";
  null != opt_a1 && this.append.apply(this, arguments)
};
goog.string.StringBuffer.prototype.set = function $goog$string$StringBuffer$$set$(s) {
  this.clear();
  this.append(s)
};
goog.userAgent.jscript.HAS_JSCRIPT ? (goog.string.StringBuffer.prototype.bufferLength_ = 0, goog.string.StringBuffer.prototype.append = function $goog$string$StringBuffer$$append$(a1, opt_a2, var_args) {
  null == opt_a2 ? this.buffer_[this.bufferLength_++] = a1 : (this.buffer_.push.apply(this.buffer_, arguments), this.bufferLength_ = this.buffer_.length);
  return this
}) : goog.string.StringBuffer.prototype.append = function $goog$string$StringBuffer$$append$(a1, opt_a2, var_args) {
  this.buffer_ += a1;
  if(null != opt_a2) {
    for(var i = 1;i < arguments.length;i++) {
      this.buffer_ += arguments[i]
    }
  }
  return this
};
goog.string.StringBuffer.prototype.clear = function $goog$string$StringBuffer$$clear$() {
  if(goog.userAgent.jscript.HAS_JSCRIPT) {
    this.bufferLength_ = this.buffer_.length = 0
  }else {
    this.buffer_ = ""
  }
};
goog.string.StringBuffer.prototype.getLength = function $goog$string$StringBuffer$$getLength$() {
  return this.toString().length
};
goog.string.StringBuffer.prototype.toString = function $goog$string$StringBuffer$$toString$() {
  if(goog.userAgent.jscript.HAS_JSCRIPT) {
    var str = this.buffer_.join("");
    this.clear();
    str && this.append(str);
    return str
  }
  return this.buffer_
};
goog.ime.plugin.lang = {};
goog.ime.plugin.lang.TranslitQuery = function $goog$ime$plugin$lang$TranslitQuery$(text, inputTool, opt_isReverse, opt_isBulk) {
  goog.ime.plugin.LookupQuery.call(this, text, opt_isReverse);
  this.queriedSugCount = this.requiredSugCount = 1;
  this.isBulk = !!opt_isBulk;
  this.requestToSegment = this.isMultiSegment = !1;
  this.historyText_ = "";
  this.useCache_ = !0;
  this.inputTool = null;
  this.inputTool = inputTool instanceof goog.ime.lang.InputTool ? inputTool : goog.ime.lang.InputTool.getInputTool(goog.ime.lang.InputToolType.IME, inputTool.targetLangCode)
};
goog.inherits(goog.ime.plugin.lang.TranslitQuery, goog.ime.plugin.LookupQuery);
goog.ime.plugin.lang.TranslitQuery.INPUT_SERVER_PATH_ = "/inputtools/request";
goog.ime.plugin.lang.TranslitQuery.CLIENT_SOURCE = "0";
goog.ime.plugin.lang.TranslitQuery.applicationName = "jsapi";
goog.ime.plugin.lang.TranslitQuery.MIN_WORDS_FOR_BULK = 5;
goog.ime.plugin.lang.TranslitQuery.getMinBounded = function $goog$ime$plugin$lang$TranslitQuery$getMinBounded$(text, inputTool, minFetchSugCount) {
  var query = new goog.ime.plugin.lang.TranslitQuery(text, inputTool);
  query.setRequiredSugCount(minFetchSugCount);
  return query
};
goog.ime.plugin.lang.TranslitQuery.createMultiSegmentQuery = function $goog$ime$plugin$lang$TranslitQuery$createMultiSegmentQuery$(text, inputTool, minFetchSugCount, requestToSegment) {
  var query = new goog.ime.plugin.lang.TranslitQuery(text, inputTool);
  query.setRequiredSugCount(minFetchSugCount);
  query.isMultiSegment = !0;
  query.requestToSegment = requestToSegment;
  return query
};
goog.ime.plugin.lang.TranslitQuery.prototype.isMultiSegmentQuery = function $goog$ime$plugin$lang$TranslitQuery$$isMultiSegmentQuery$() {
  return this.isMultiSegment
};
goog.ime.plugin.lang.TranslitQuery.prototype.useCache = function $goog$ime$plugin$lang$TranslitQuery$$useCache$() {
  return this.useCache_
};
goog.ime.plugin.lang.TranslitQuery.prototype.setUseCache = function $goog$ime$plugin$lang$TranslitQuery$$setUseCache$(useCache) {
  this.useCache_ = useCache
};
goog.ime.plugin.lang.TranslitQuery.prototype.setHistoryText = function $goog$ime$plugin$lang$TranslitQuery$$setHistoryText$(text) {
  this.historyText_ = text
};
goog.ime.plugin.lang.TranslitQuery.prototype.getQueriedSugCount = function $goog$ime$plugin$lang$TranslitQuery$$getQueriedSugCount$() {
  return this.queriedSugCount || 0
};
goog.ime.plugin.lang.TranslitQuery.prototype.setQueriedSugCount = function $goog$ime$plugin$lang$TranslitQuery$$setQueriedSugCount$(queriedSugCount) {
  this.queriedSugCount = 0 < queriedSugCount ? queriedSugCount : 0
};
goog.ime.plugin.lang.TranslitQuery.prototype.getRequiredSugCount = function $goog$ime$plugin$lang$TranslitQuery$$getRequiredSugCount$() {
  return this.requiredSugCount || 0
};
goog.ime.plugin.lang.TranslitQuery.prototype.setRequiredSugCount = function $goog$ime$plugin$lang$TranslitQuery$$setRequiredSugCount$(minFetchSugCount) {
  this.requiredSugCount = 0 < minFetchSugCount ? minFetchSugCount : 0
};
goog.ime.plugin.lang.TranslitQuery.prototype.getText = function $goog$ime$plugin$lang$TranslitQuery$$getText$() {
  return this.isMultiSegment ? this.requestToSegment ? this.text.join("") : this.text.join(",") + "," : goog.ime.plugin.lang.TranslitQuery.superClass_.getText.call(this)
};
goog.ime.plugin.lang.TranslitQuery.prototype.hashKey = function $goog$ime$plugin$lang$TranslitQuery$$hashKey$() {
  return[this.inputTool.toString()]
};
goog.ime.plugin.lang.TranslitQuery.prototype.merge = function $goog$ime$plugin$lang$TranslitQuery$$merge$(query) {
  return this.inputTool == query.inputTool && !this.isBulk && !query.isBulk && !this.isReverse && !query.isReverse && this.text.length + query.text.length < goog.ime.plugin.lang.TranslitQuery.MIN_WORDS_FOR_BULK ? (goog.array.contains(this.text, query.text) || goog.array.extend(this.text, query.text), query.getRequiredSugCount() > this.getRequiredSugCount() && this.setRequiredSugCount(query.getRequiredSugCount()), !0) : !1
};
goog.ime.plugin.lang.TranslitQuery.prototype.satisfies = function $goog$ime$plugin$lang$TranslitQuery$$satisfies$(query) {
  return goog.array.every(query.text, function(text) {
    return goog.array.contains(this.text, text)
  }, this) && this.requiredSugCount >= query.getRequiredSugCount()
};
goog.ime.plugin.lang.TranslitQuery.prototype.getIMEName = function $goog$ime$plugin$lang$TranslitQuery$$getIMEName$() {
  switch(this.inputTool.code) {
    case goog.ime.lang.InputToolCode.INPUTMETHOD_PINYIN_CHINESE_SIMPLIFIED:
      return"pinyin";
    case goog.ime.lang.InputToolCode.INPUTMETHOD_PINYIN_CHINESE_TRADITIONAL:
      return"pinyin_hant";
    case goog.ime.lang.InputToolCode.INPUTMETHOD_ZHUYIN_CHINESE_TRADITIONAL:
      return"bopomofo";
    case goog.ime.lang.InputToolCode.INPUTMETHOD_WUBI_CHINESE_SIMPLIFIED:
      return"wubi86";
    case goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HIRAGANA:
    ;
    case goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_JAPANESE:
      return"transliteration_ja-Hira_ja"
  }
  return"transliteration_en_" + this.inputTool.languageCode
};
goog.ime.plugin.lang.TranslitQuery.prototype.replaceSpecialChar = function $goog$ime$plugin$lang$TranslitQuery$$replaceSpecialChar$(text) {
  for(var sb = new goog.string.StringBuffer, i = 0;i < text.length;i++) {
    var ch = text.charAt(i);
    switch(ch) {
      case ",":
        sb.append("%2C");
        break;
      case "|":
        sb.append("%7C");
        break;
      case "%":
        sb.append("%25");
        break;
      default:
        sb.append(ch)
    }
  }
  return sb.toString()
};
goog.ime.plugin.lang.TranslitQuery.prototype.buildRequest = function $goog$ime$plugin$lang$TranslitQuery$$buildRequest$(paramConfig, addlPayload) {
  var url = goog.ime.plugin.lang.TranslitQuery.INPUT_SERVER_PATH_, suffix = "";
  switch(this.inputTool.languageCode) {
    case goog.ime.lang.LanguageCode.HIRAGANA:
    ;
    case goog.ime.lang.LanguageCode.JAPANESE:
      suffix = this.requestToSegment ? "||t:1" : ",||t:1"
  }
  var encodeTextSb = new goog.string.StringBuffer;
  this.historyText_ && (encodeTextSb.append("|"), encodeTextSb.append(this.replaceSpecialChar(this.historyText_)), encodeTextSb.append(","));
  goog.array.forEach(this.text, function(str, i) {
    encodeTextSb.append(this.replaceSpecialChar(str));
    i != this.text.length - 1 && encodeTextSb.append(",")
  }, this);
  encodeTextSb.append(suffix);
  var payload = {text:encodeTextSb.toString(), ime:this.getIMEName(), num:this.queriedSugCount, cp:"0", cs:goog.ime.plugin.lang.TranslitQuery.CLIENT_SOURCE, ie:"utf-8", oe:"utf-8", app:goog.ime.plugin.lang.TranslitQuery.applicationName};
  paramConfig.securityToken && (payload.sct = paramConfig.securityToken);
  goog.object.extend(payload, addlPayload);
  return new goog.ime.net.AsyncHttpRequest(url, payload)
};
goog.ime.plugin.lang.TranslitQuery.prototype.getSingleTextQuery = function $goog$ime$plugin$lang$TranslitQuery$$getSingleTextQuery$(i) {
  var text = "";
  0 <= i && i < this.text.length && (text = this.text[i]);
  var query = new goog.ime.plugin.lang.TranslitQuery(text, this.inputTool, this.isReverse, this.isBulk);
  query.setQueriedSugCount(this.queriedSugCount);
  query.setRequiredSugCount(this.requiredSugCount);
  return query
};
goog.ime.plugin.CommandType = {CHANGE_STATE:"changeState", CHANGE_DIRECTION:"cd", TOGGLE_ITA:"tita", TOGGLE_SBC:"tsbc", TOGGLE_LANGUAGE:"tlang", PUNCTUATION:"pun", SHOW_KEYBOARD:"sk", LOAD_LAYOUT:"ll"};
goog.events.KeyHandler = function $goog$events$KeyHandler$(opt_element, opt_capture) {
  goog.events.EventTarget.call(this);
  opt_element && this.attach(opt_element, opt_capture)
};
goog.inherits(goog.events.KeyHandler, goog.events.EventTarget);
goog.events.KeyHandler.prototype.element_ = null;
goog.events.KeyHandler.prototype.keyPressKey_ = null;
goog.events.KeyHandler.prototype.keyDownKey_ = null;
goog.events.KeyHandler.prototype.keyUpKey_ = null;
goog.events.KeyHandler.prototype.lastKey_ = -1;
goog.events.KeyHandler.prototype.keyCode_ = -1;
goog.events.KeyHandler.EventType = {KEY:"key"};
goog.events.KeyHandler.safariKey_ = {3:goog.events.KeyCodes.ENTER, 12:goog.events.KeyCodes.NUMLOCK, 63232:goog.events.KeyCodes.UP, 63233:goog.events.KeyCodes.DOWN, 63234:goog.events.KeyCodes.LEFT, 63235:goog.events.KeyCodes.RIGHT, 63236:goog.events.KeyCodes.F1, 63237:goog.events.KeyCodes.F2, 63238:goog.events.KeyCodes.F3, 63239:goog.events.KeyCodes.F4, 63240:goog.events.KeyCodes.F5, 63241:goog.events.KeyCodes.F6, 63242:goog.events.KeyCodes.F7, 63243:goog.events.KeyCodes.F8, 63244:goog.events.KeyCodes.F9, 
63245:goog.events.KeyCodes.F10, 63246:goog.events.KeyCodes.F11, 63247:goog.events.KeyCodes.F12, 63248:goog.events.KeyCodes.PRINT_SCREEN, 63272:goog.events.KeyCodes.DELETE, 63273:goog.events.KeyCodes.HOME, 63275:goog.events.KeyCodes.END, 63276:goog.events.KeyCodes.PAGE_UP, 63277:goog.events.KeyCodes.PAGE_DOWN, 63289:goog.events.KeyCodes.NUMLOCK, 63302:goog.events.KeyCodes.INSERT};
goog.events.KeyHandler.keyIdentifier_ = {Up:goog.events.KeyCodes.UP, Down:goog.events.KeyCodes.DOWN, Left:goog.events.KeyCodes.LEFT, Right:goog.events.KeyCodes.RIGHT, Enter:goog.events.KeyCodes.ENTER, F1:goog.events.KeyCodes.F1, F2:goog.events.KeyCodes.F2, F3:goog.events.KeyCodes.F3, F4:goog.events.KeyCodes.F4, F5:goog.events.KeyCodes.F5, F6:goog.events.KeyCodes.F6, F7:goog.events.KeyCodes.F7, F8:goog.events.KeyCodes.F8, F9:goog.events.KeyCodes.F9, F10:goog.events.KeyCodes.F10, F11:goog.events.KeyCodes.F11, 
F12:goog.events.KeyCodes.F12, "U+007F":goog.events.KeyCodes.DELETE, Home:goog.events.KeyCodes.HOME, End:goog.events.KeyCodes.END, PageUp:goog.events.KeyCodes.PAGE_UP, PageDown:goog.events.KeyCodes.PAGE_DOWN, Insert:goog.events.KeyCodes.INSERT};
goog.events.KeyHandler.USES_KEYDOWN_ = goog.userAgent.IE || goog.userAgent.WEBKIT && goog.userAgent.isVersion("525");
goog.events.KeyHandler.prototype.handleKeyDown_ = function $goog$events$KeyHandler$$handleKeyDown_$(e) {
  if(goog.userAgent.WEBKIT && (this.lastKey_ == goog.events.KeyCodes.CTRL && !e.ctrlKey || this.lastKey_ == goog.events.KeyCodes.ALT && !e.altKey)) {
    this.keyCode_ = this.lastKey_ = -1
  }
  goog.events.KeyHandler.USES_KEYDOWN_ && !goog.events.KeyCodes.firesKeyPressEvent(e.keyCode, this.lastKey_, e.shiftKey, e.ctrlKey, e.altKey) ? this.handleEvent(e) : this.keyCode_ = goog.userAgent.GECKO ? goog.events.KeyCodes.normalizeGeckoKeyCode(e.keyCode) : e.keyCode
};
goog.events.KeyHandler.prototype.handleKeyup_ = function $goog$events$KeyHandler$$handleKeyup_$() {
  this.keyCode_ = this.lastKey_ = -1
};
goog.events.KeyHandler.prototype.handleEvent = function $goog$events$KeyHandler$$handleEvent$(e) {
  var be = e.getBrowserEvent(), keyCode, charCode;
  goog.userAgent.IE && e.type == goog.events.EventType.KEYPRESS ? (keyCode = this.keyCode_, charCode = keyCode != goog.events.KeyCodes.ENTER && keyCode != goog.events.KeyCodes.ESC ? be.keyCode : 0) : goog.userAgent.WEBKIT && e.type == goog.events.EventType.KEYPRESS ? (keyCode = this.keyCode_, charCode = 0 <= be.charCode && 63232 > be.charCode && goog.events.KeyCodes.isCharacterKey(keyCode) ? be.charCode : 0) : goog.userAgent.OPERA ? (keyCode = this.keyCode_, charCode = goog.events.KeyCodes.isCharacterKey(keyCode) ? 
  be.keyCode : 0) : (keyCode = be.keyCode || this.keyCode_, charCode = be.charCode || 0, goog.userAgent.MAC && charCode == goog.events.KeyCodes.QUESTION_MARK && keyCode == goog.events.KeyCodes.WIN_KEY && (keyCode = goog.events.KeyCodes.SLASH));
  var key = keyCode, keyIdentifier = be.keyIdentifier;
  keyCode ? 63232 <= keyCode && keyCode in goog.events.KeyHandler.safariKey_ ? key = goog.events.KeyHandler.safariKey_[keyCode] : 25 == keyCode && e.shiftKey && (key = 9) : keyIdentifier && keyIdentifier in goog.events.KeyHandler.keyIdentifier_ && (key = goog.events.KeyHandler.keyIdentifier_[keyIdentifier]);
  var repeat = key == this.lastKey_;
  this.lastKey_ = key;
  var event = new goog.events.KeyEvent(key, charCode, repeat, be);
  try {
    this.dispatchEvent(event)
  }finally {
    event.dispose()
  }
};
goog.events.KeyHandler.prototype.getElement = function $goog$events$KeyHandler$$getElement$() {
  return this.element_
};
goog.events.KeyHandler.prototype.attach = function $goog$events$KeyHandler$$attach$(element, opt_capture) {
  this.keyUpKey_ && this.detach();
  this.element_ = element;
  this.keyPressKey_ = goog.events.listen(this.element_, goog.events.EventType.KEYPRESS, this, opt_capture);
  this.keyDownKey_ = goog.events.listen(this.element_, goog.events.EventType.KEYDOWN, this.handleKeyDown_, opt_capture, this);
  this.keyUpKey_ = goog.events.listen(this.element_, goog.events.EventType.KEYUP, this.handleKeyup_, opt_capture, this)
};
goog.events.KeyHandler.prototype.detach = function $goog$events$KeyHandler$$detach$() {
  this.keyPressKey_ && (goog.events.unlistenByKey(this.keyPressKey_), goog.events.unlistenByKey(this.keyDownKey_), goog.events.unlistenByKey(this.keyUpKey_), this.keyUpKey_ = this.keyDownKey_ = this.keyPressKey_ = null);
  this.element_ = null;
  this.keyCode_ = this.lastKey_ = -1
};
goog.events.KeyHandler.prototype.disposeInternal = function $goog$events$KeyHandler$$disposeInternal$() {
  goog.events.KeyHandler.superClass_.disposeInternal.call(this);
  this.detach()
};
goog.events.KeyEvent = function $goog$events$KeyEvent$(keyCode, charCode, repeat, browserEvent) {
  goog.events.BrowserEvent.call(this, browserEvent);
  this.type = goog.events.KeyHandler.EventType.KEY;
  this.keyCode = keyCode;
  this.charCode = charCode;
  this.repeat = repeat
};
goog.inherits(goog.events.KeyEvent, goog.events.BrowserEvent);
goog.ime.plugin.EventUtil = {};
goog.ime.plugin.EventUtil.SAFARI_KEY = {3:goog.events.KeyCodes.ENTER, 12:goog.events.KeyCodes.NUMLOCK, 63232:goog.events.KeyCodes.UP, 63233:goog.events.KeyCodes.DOWN, 63234:goog.events.KeyCodes.LEFT, 63235:goog.events.KeyCodes.RIGHT, 63236:goog.events.KeyCodes.F1, 63237:goog.events.KeyCodes.F2, 63238:goog.events.KeyCodes.F3, 63239:goog.events.KeyCodes.F4, 63240:goog.events.KeyCodes.F5, 63241:goog.events.KeyCodes.F6, 63242:goog.events.KeyCodes.F7, 63243:goog.events.KeyCodes.F8, 63244:goog.events.KeyCodes.F9, 
63245:goog.events.KeyCodes.F10, 63246:goog.events.KeyCodes.F11, 63247:goog.events.KeyCodes.F12, 63248:goog.events.KeyCodes.PRINT_SCREEN, 63272:goog.events.KeyCodes.DELETE, 63273:goog.events.KeyCodes.HOME, 63275:goog.events.KeyCodes.END, 63276:goog.events.KeyCodes.PAGE_UP, 63277:goog.events.KeyCodes.PAGE_DOWN, 63289:goog.events.KeyCodes.NUMLOCK, 63302:goog.events.KeyCodes.INSERT};
goog.ime.plugin.EventUtil.KEY_IDENTIFIER = {Up:goog.events.KeyCodes.UP, Down:goog.events.KeyCodes.DOWN, Left:goog.events.KeyCodes.LEFT, Right:goog.events.KeyCodes.RIGHT, Enter:goog.events.KeyCodes.ENTER, F1:goog.events.KeyCodes.F1, F2:goog.events.KeyCodes.F2, F3:goog.events.KeyCodes.F3, F4:goog.events.KeyCodes.F4, F5:goog.events.KeyCodes.F5, F6:goog.events.KeyCodes.F6, F7:goog.events.KeyCodes.F7, F8:goog.events.KeyCodes.F8, F9:goog.events.KeyCodes.F9, F10:goog.events.KeyCodes.F10, F11:goog.events.KeyCodes.F11, 
F12:goog.events.KeyCodes.F12, "U+007F":goog.events.KeyCodes.DELETE, Home:goog.events.KeyCodes.HOME, End:goog.events.KeyCodes.END, PageUp:goog.events.KeyCodes.PAGE_UP, PageDown:goog.events.KeyCodes.PAGE_DOWN, Insert:goog.events.KeyCodes.INSERT};
goog.ime.plugin.EventUtil.MOZ_KEYCODE_TO_KEYCODE_MAP = {61:187, 59:186};
goog.ime.plugin.EventUtil.USES_KEYDOWN_ = goog.userAgent.IE || goog.userAgent.WEBKIT && goog.userAgent.isVersion("525");
goog.ime.plugin.EventUtil.isModifierEvent = function $goog$ime$plugin$EventUtil$isModifierEvent$(e) {
  var eventType = e.type;
  switch(eventType) {
    case goog.events.EventType.KEYDOWN:
    ;
    case goog.events.EventType.KEYPRESS:
      if(e.ctrlKey || e.metaKey || e.altKey) {
        return!0
      }
      break;
    case goog.events.EventType.CLICK:
      if(e.ctrlKey || e.metaKey || e.altKey || e.shiftKey) {
        return!0
      }
      break;
    case goog.events.KeyHandler.EventType.KEY:
      if(e.ctrlKey || e.metaKey || e.altKey || e.shiftKey || e.platformModifierKey) {
        return!0
      }
  }
  return!1
};
goog.ime.plugin.EventUtil.generateKeyEvent = function $goog$ime$plugin$EventUtil$generateKeyEvent$(e, status) {
  switch(e.type) {
    case goog.events.EventType.KEYDOWN:
      return goog.ime.plugin.EventUtil.handleKeyDown_(e, status);
    case goog.events.EventType.KEYUP:
      status.lastKey = -1;
      status.keyCode = -1;
      break;
    case goog.events.EventType.KEYPRESS:
      return goog.ime.plugin.EventUtil.handleKeyPress_(e, status)
  }
  return null
};
goog.ime.plugin.EventUtil.handleKeyDown_ = function $goog$ime$plugin$EventUtil$handleKeyDown_$(e, status) {
  if(goog.userAgent.WEBKIT && (status.lastKey == goog.events.KeyCodes.CTRL && !e.ctrlKey || status.lastKey == goog.events.KeyCodes.ALT && !e.altKey)) {
    status.lastKey = -1, status.keyCode = -1
  }
  if(goog.ime.plugin.EventUtil.USES_KEYDOWN_ && !goog.events.KeyCodes.firesKeyPressEvent(e.keyCode, status.lastKey, e.shiftKey, e.ctrlKey, e.altKey)) {
    return goog.ime.plugin.EventUtil.handleKeyPress_(e, status)
  }
  status.keyCode = goog.userAgent.GECKO && e.keyCode in goog.ime.plugin.EventUtil.MOZ_KEYCODE_TO_KEYCODE_MAP ? goog.ime.plugin.EventUtil.MOZ_KEYCODE_TO_KEYCODE_MAP[e.keyCode] : e.keyCode;
  return null
};
goog.ime.plugin.EventUtil.handleKeyPress_ = function $goog$ime$plugin$EventUtil$handleKeyPress_$(e, status) {
  var be = e.getBrowserEvent(), keyCode, charCode;
  goog.userAgent.IE && e.type == goog.events.EventType.KEYPRESS ? (keyCode = status.keyCode, charCode = keyCode != goog.events.KeyCodes.ENTER && keyCode != goog.events.KeyCodes.ESC ? be.keyCode : 0) : goog.userAgent.WEBKIT && e.type == goog.events.EventType.KEYPRESS ? (keyCode = status.keyCode, charCode = 0 <= be.charCode && 63232 > be.charCode && goog.events.KeyCodes.isCharacterKey(keyCode) ? be.charCode : 0) : goog.userAgent.OPERA ? (keyCode = status.keyCode, charCode = goog.events.KeyCodes.isCharacterKey(keyCode) ? 
  be.keyCode : 0) : (keyCode = be.keyCode || status.keyCode, charCode = be.charCode || 0, goog.userAgent.MAC && charCode == goog.events.KeyCodes.QUESTION_MARK && !keyCode && (keyCode = goog.events.KeyCodes.SLASH));
  var key = keyCode, keyIdentifier = be.keyIdentifier;
  keyCode ? 63232 <= keyCode && keyCode in goog.ime.plugin.EventUtil.SAFARI_KEY ? key = goog.ime.plugin.EventUtil.SAFARI_KEY[keyCode] : 25 == keyCode && e.shiftKey && (key = 9) : keyIdentifier && keyIdentifier in goog.ime.plugin.EventUtil.KEY_IDENTIFIER && (key = goog.ime.plugin.EventUtil.KEY_IDENTIFIER[keyIdentifier]);
  var repeat = key == status.lastKey;
  status.lastKey = key;
  var event = new goog.events.KeyEvent(key, charCode, repeat, be);
  return event
};
goog.ime.plugin.EventUtil.isBackspace = function $goog$ime$plugin$EventUtil$isBackspace$(e) {
  var isBspKey = e.keyCode == goog.events.KeyCodes.BACKSPACE, eventType = goog.userAgent.GECKO ? goog.events.EventType.KEYPRESS : goog.events.EventType.KEYDOWN;
  return e.type == eventType && isBspKey
};
goog.ime.plugin.EventUtil.isFakeEvent = function $goog$ime$plugin$EventUtil$isFakeEvent$(e) {
  e.getBrowserEvent && (e = e.getBrowserEvent());
  if(e.getAttribute) {
    if(e.getAttribute("isFake")) {
      return!0
    }
  }else {
    if(!1 == e.isTrusted) {
      return!0
    }
  }
  return!1
};
goog.ime.plugin.EventUtil.sendFakeKeyUp = function $goog$ime$plugin$EventUtil$sendFakeKeyUp$(element, keyCode) {
  var win = goog.dom.getDomHelper(element).getWindow(), doc = win.document, evObj;
  win.KeyEvent ? (evObj = doc.createEvent("KeyEvents"), evObj.initKeyEvent("keyup", !0, !0, win, !1, !1, !0, !1, keyCode, 0), element.dispatchEvent(evObj)) : doc.createEvent ? (evObj = doc.createEvent("UIEvents"), evObj.initUIEvent("keyup", !0, !0, win, 1), evObj.keyCode = keyCode, element.dispatchEvent(evObj)) : doc.createEventObject && element.fireEvent && (evObj = doc.createEventObject(), evObj.bubbles = !0, evObj.cancelable = !0, evObj.view = win, evObj.ctrlKey = !1, evObj.altKey = !1, evObj.shiftKey = 
  !0, evObj.metaKey = !1, evObj.keyCode = keyCode, evObj.setAttribute && evObj.setAttribute("isFake", !0), element.fireEvent("onkeyup", evObj))
};
goog.ime.lang.ScriptCode = {ARAB:"Arab", ARMI:"Armi", ARMN:"Armn", AVST:"Avst", BALI:"Bali", BATK:"Batk", BENG:"Beng", BLIS:"Blis", BOPO:"Bopo", BRAH:"Brah", BRAI:"Brai", BUGI:"Bugi", BUHD:"Buhd", CAKM:"Cakm", CANS:"Cans", CARI:"Cari", CHAM:"Cham", CHER:"Cher", CIRT:"Cirt", COPT:"Copt", CPRT:"Cprt", CYRL:"Cyrl", CYRS:"Cyrs", DEVA:"Deva", DSRT:"Dsrt", EGYD:"Egyd", EGYH:"Egyh", EGYP:"Egyp", ETHI:"Ethi", GEOK:"Geok", GEOR:"Geor", GLAG:"Glag", GOTH:"Goth", GREK:"Grek", GUJR:"Gujr", GURU:"Guru", HANG:"Hang", 
HANI:"Hani", HANO:"Hano", HANS:"Hans", HANT:"Hant", HEBR:"Hebr", HIRA:"Hira", HMNG:"Hmng", HRKT:"Hrkt", HUNG:"Hung", INDS:"Inds", ITAL:"Ital", JAVA:"Java", JPAN:"Jpan", KALI:"Kali", KANA:"Kana", KHAR:"Khar", KHMR:"Khmr", KNDA:"Knda", KORE:"Kore", KTHI:"Kthi", LANA:"Lana", LAOO:"Laoo", LATF:"Latf", LATG:"Latg", LATN:"Latn", LEPC:"Lepc", LIMB:"Limb", LINA:"Lina", LINB:"Linb", LYCI:"Lyci", LYDI:"Lydi", MAND:"Mand", MANI:"Mani", MAYA:"Maya", MERO:"Mero", MLYM:"Mlym", MONG:"Mong", MOON:"Moon", MTEI:"Mtei", 
MYMR:"Mymr", NKOO:"Nkoo", OGAM:"Ogam", OLCK:"Olck", ORKH:"Orkh", ORYA:"Orya", OSMA:"Osma", PERM:"Perm", PHAG:"Phag", PHLI:"Phli", PHLP:"Phlp", PHLV:"Phlv", PHNX:"Phnx", PLRD:"Plrd", PRTI:"Prti", QAAI:"Qaai", RJNG:"Rjng", RORO:"Roro", RUNR:"Runr", SAMR:"Samr", SARA:"Sara", SAUR:"Saur", SGNW:"Sgnw", SHAW:"Shaw", SINH:"Sinh", SUND:"Sund", SYLO:"Sylo", SYRC:"Syrc", SYRE:"Syre", SYRJ:"Syrj", SYRN:"Syrn", TAGB:"Tagb", TALE:"Tale", TALU:"Talu", TAML:"Taml", TAVT:"Tavt", TELU:"Telu", TENG:"Teng", TFNG:"Tfng", 
TGLG:"Tglg", THAA:"Thaa", THAI:"Thai", TIBT:"Tibt", UGAR:"Ugar", VAII:"Vaii", VISP:"Visp", XPEO:"Xpeo", XSUX:"Xsux", YIII:"Yiii", ZMTH:"Zmth", ZSYM:"Zsym", ZXXX:"Zxxx", ZYYY:"Zyyy", ZZZZ:"Zzzz"};
goog.ime.lang.scripts = {};
goog.ime.lang.scripts.Ethiopic = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.ETHI, [{start:"\u1200", end:"\u137f"}], "\u1360\u1361\u1362\u1363\u1364\u1365\u1366\u1367\u1368" + goog.ime.lang.Script.DELIMITER_CHARS, {fontSize:14, lineHeight:1.5, minTextEditHeight:24});
goog.ime.lang.languages = {};
var JSCompiler_temp_const$$8 = goog.ime.lang.languages, JSCompiler_inline_result$$27;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.ETHI, goog.ime.lang.scripts.Ethiopic);
var amharic$$inline_28 = new goog.ime.lang.Language("AMHARIC", goog.ime.lang.LanguageCode.AMHARIC, "Amharic", goog.ime.lang.scripts.Ethiopic);
JSCompiler_inline_result$$27 = amharic$$inline_28;
JSCompiler_temp_const$$8.Amharic = JSCompiler_inline_result$$27;
goog.ime.lang.scripts.Arabic = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.ARAB, [{start:"\u0600", end:"\u06ff"}], "\u060c\u061b\u061f\u06d4" + goog.ime.lang.Script.DELIMITER_CHARS, {fontSize:16, lineHeight:1.8, minTextEditHeight:28}, !0);
var JSCompiler_temp_const$$7 = goog.ime.lang.languages, JSCompiler_inline_result$$30;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.ARAB, goog.ime.lang.scripts.Arabic);
var arabic$$inline_31 = new goog.ime.lang.Language("ARABIC", goog.ime.lang.LanguageCode.ARABIC, "Arabic", goog.ime.lang.scripts.Arabic);
JSCompiler_inline_result$$30 = arabic$$inline_31;
JSCompiler_temp_const$$7.Arabic = JSCompiler_inline_result$$30;
goog.ime.lang.scripts.Bengali = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.BENG, [{start:"\u0980", end:"\u09ff"}, {start:"\u200c", end:"\u200d"}], goog.ime.lang.Script.DELIMITER_CHARS, {fontSize:16, lineHeight:1.8, minTextEditHeight:28});
var JSCompiler_temp_const$$6 = goog.ime.lang.languages, JSCompiler_inline_result$$33;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.BENG, goog.ime.lang.scripts.Bengali);
var bengali$$inline_34 = new goog.ime.lang.Language("BENGALI", goog.ime.lang.LanguageCode.BENGALI, "Bengali", goog.ime.lang.scripts.Bengali);
JSCompiler_inline_result$$33 = bengali$$inline_34;
JSCompiler_temp_const$$6.Bengali = JSCompiler_inline_result$$33;
goog.ime.lang.scripts.Latin = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.LATN, [{start:"a", end:"z"}, {start:"A", end:"Z"}, {start:"0", end:"9"}], goog.ime.lang.Script.DELIMITER_CHARS);
var JSCompiler_temp_const$$5 = goog.ime.lang.languages, JSCompiler_inline_result$$36;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.LATN, goog.ime.lang.scripts.Latin);
var english$$inline_37 = new goog.ime.lang.Language("ENGLISH", goog.ime.lang.LanguageCode.ENGLISH, "English", goog.ime.lang.scripts.Latin);
JSCompiler_inline_result$$36 = english$$inline_37;
JSCompiler_temp_const$$5.English = JSCompiler_inline_result$$36;
goog.ime.lang.scripts.Greek = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.GREK, [{start:"\u0370", end:"\u03ff"}, {start:"0", end:"9"}], goog.ime.lang.Script.DELIMITER_CHARS, {fontSize:16, lineHeight:1.8, minTextEditHeight:28});
var JSCompiler_temp_const$$12 = goog.ime.lang.languages, JSCompiler_inline_result$$39;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.GREK, goog.ime.lang.scripts.Greek);
var greek$$inline_40 = new goog.ime.lang.Language("GREEK", goog.ime.lang.LanguageCode.GREEK, "Greek", goog.ime.lang.scripts.Greek);
JSCompiler_inline_result$$39 = greek$$inline_40;
JSCompiler_temp_const$$12.Greek = JSCompiler_inline_result$$39;
goog.ime.lang.scripts.Gujarati = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.GUJR, [{start:"\u0a80", end:"\u0aff"}], goog.ime.lang.Script.DELIMITER_CHARS, {fontSize:16, lineHeight:1.8, minTextEditHeight:28});
var JSCompiler_temp_const$$11 = goog.ime.lang.languages, JSCompiler_inline_result$$42;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.GUJR, goog.ime.lang.scripts.Gujarati);
var gujarati$$inline_43 = new goog.ime.lang.Language("GUJARATI", goog.ime.lang.LanguageCode.GUJARATI, "Gujarati", goog.ime.lang.scripts.Gujarati);
JSCompiler_inline_result$$42 = gujarati$$inline_43;
JSCompiler_temp_const$$11.Gujarati = JSCompiler_inline_result$$42;
goog.ime.lang.scripts.Hebrew = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.HEBR, [{start:"\u0590", end:"\u05ff"}, {start:"0", end:"9"}], goog.ime.lang.Script.DELIMITER_CHARS, {fontSize:16, lineHeight:1.8, minTextEditHeight:28}, !0);
var JSCompiler_temp_const$$10 = goog.ime.lang.languages, JSCompiler_inline_result$$45;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.HEBR, goog.ime.lang.scripts.Hebrew);
var hebrew$$inline_46 = new goog.ime.lang.Language("HEBREW", goog.ime.lang.LanguageCode.HEBREW, "Hebrew", goog.ime.lang.scripts.Hebrew);
JSCompiler_inline_result$$45 = hebrew$$inline_46;
JSCompiler_temp_const$$10.Hebrew = JSCompiler_inline_result$$45;
goog.ime.lang.scripts.Devanagari = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.DEVA, [{start:"\u0900", end:"\u097f"}], "\u0964\u0965" + goog.ime.lang.Script.DELIMITER_CHARS, {fontSize:14, lineHeight:1.5, minTextEditHeight:24});
var JSCompiler_temp_const$$9 = goog.ime.lang.languages, JSCompiler_inline_result$$48;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.DEVA, goog.ime.lang.scripts.Devanagari);
var hindi$$inline_49 = new goog.ime.lang.Language("HINDI", goog.ime.lang.LanguageCode.HINDI, "Hindi", goog.ime.lang.scripts.Devanagari);
JSCompiler_inline_result$$48 = hindi$$inline_49;
JSCompiler_temp_const$$9.Hindi = JSCompiler_inline_result$$48;
goog.ime.lang.scripts.Japanese = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.JPAN, [{start:"\u3040", end:"\u309f"}, {start:"\u30a0", end:"\u30ff"}, {start:"\u3400", end:"\u9fff"}], "");
var JSCompiler_temp_const$$14 = goog.ime.lang.languages, JSCompiler_inline_result$$51;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.JPAN, goog.ime.lang.scripts.Japanese);
var japanese$$inline_52 = new goog.ime.lang.Language("JAPANESE", goog.ime.lang.LanguageCode.JAPANESE, "Japanese", goog.ime.lang.scripts.Japanese);
JSCompiler_inline_result$$51 = japanese$$inline_52;
JSCompiler_temp_const$$14.Japanese = JSCompiler_inline_result$$51;
goog.ime.lang.scripts.Kannada = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.KNDA, [{start:"\u0c80", end:"\u0cff"}], goog.ime.lang.Script.DELIMITER_CHARS, {fontSize:16, lineHeight:1.8, minTextEditHeight:28});
var JSCompiler_temp_const$$13 = goog.ime.lang.languages, JSCompiler_inline_result$$54;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.KNDA, goog.ime.lang.scripts.Kannada);
var kannada$$inline_55 = new goog.ime.lang.Language("KANNADA", goog.ime.lang.LanguageCode.KANNADA, "Kannada", goog.ime.lang.scripts.Kannada);
JSCompiler_inline_result$$54 = kannada$$inline_55;
JSCompiler_temp_const$$13.Kannada = JSCompiler_inline_result$$54;
goog.ime.lang.scripts.Malayalam = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.MLYM, [{start:"\u0d00", end:"\u0d7f"}, {start:"\u200c", end:"\u200d"}], goog.ime.lang.Script.DELIMITER_CHARS, {fontSize:16, lineHeight:1.8, minTextEditHeight:28});
var JSCompiler_temp_const$$26 = goog.ime.lang.languages, JSCompiler_inline_result$$57;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.MLYM, goog.ime.lang.scripts.Malayalam);
var malayalam$$inline_58 = new goog.ime.lang.Language("MALAYALAM", goog.ime.lang.LanguageCode.MALAYALAM, "Malayalam", goog.ime.lang.scripts.Malayalam);
JSCompiler_inline_result$$57 = malayalam$$inline_58;
JSCompiler_temp_const$$26.Malayalam = JSCompiler_inline_result$$57;
var JSCompiler_temp_const$$22 = goog.ime.lang.languages, JSCompiler_inline_result$$60;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.DEVA, goog.ime.lang.scripts.Devanagari);
var marathi$$inline_61 = new goog.ime.lang.Language("MARATHI", goog.ime.lang.LanguageCode.MARATHI, "Marathi", goog.ime.lang.scripts.Devanagari);
JSCompiler_inline_result$$60 = marathi$$inline_61;
JSCompiler_temp_const$$22.Marathi = JSCompiler_inline_result$$60;
var JSCompiler_temp_const$$23 = goog.ime.lang.languages, JSCompiler_inline_result$$63;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.DEVA, goog.ime.lang.scripts.Devanagari);
var nepali$$inline_64 = new goog.ime.lang.Language("NEPALI", goog.ime.lang.LanguageCode.NEPALI, "Nepali", goog.ime.lang.scripts.Devanagari);
JSCompiler_inline_result$$63 = nepali$$inline_64;
JSCompiler_temp_const$$23.Nepali = JSCompiler_inline_result$$63;
goog.ime.lang.scripts.Oriya = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.ORYA, [{start:"\u0b00", end:"\u0b7f"}, {start:"\u200c", end:"\u200d"}], goog.ime.lang.Script.DELIMITER_CHARS, {fontSize:16, lineHeight:1.8, minTextEditHeight:28});
var JSCompiler_temp_const$$20 = goog.ime.lang.languages, JSCompiler_inline_result$$66;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.ORYA, goog.ime.lang.scripts.Oriya);
var oriya$$inline_67 = new goog.ime.lang.Language("ORIYA", goog.ime.lang.LanguageCode.ORIYA, "Oriya", goog.ime.lang.scripts.Oriya);
JSCompiler_inline_result$$66 = oriya$$inline_67;
JSCompiler_temp_const$$20.Oriya = JSCompiler_inline_result$$66;
var JSCompiler_temp_const$$21 = goog.ime.lang.languages, JSCompiler_inline_result$$69;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.ARAB, goog.ime.lang.scripts.Arabic);
var persian$$inline_70 = new goog.ime.lang.Language("PERSIAN", goog.ime.lang.LanguageCode.PERSIAN, "Persian", goog.ime.lang.scripts.Arabic);
JSCompiler_inline_result$$69 = persian$$inline_70;
JSCompiler_temp_const$$21.Persian = JSCompiler_inline_result$$69;
goog.ime.lang.scripts.Gurumukhi = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.GURU, [{start:"\u0a00", end:"\u0a7f"}], "\u0964\u0965" + goog.ime.lang.Script.DELIMITER_CHARS, {fontSize:14, lineHeight:1.5, minTextEditHeight:24});
var JSCompiler_temp_const$$18 = goog.ime.lang.languages, JSCompiler_inline_result$$72;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.GURU, goog.ime.lang.scripts.Gurumukhi);
var punjabi$$inline_73 = new goog.ime.lang.Language("PUNJABI", goog.ime.lang.LanguageCode.PUNJABI, "Punjabi", goog.ime.lang.scripts.Gurumukhi);
JSCompiler_inline_result$$72 = punjabi$$inline_73;
JSCompiler_temp_const$$18.Punjabi = JSCompiler_inline_result$$72;
goog.ime.lang.scripts.Cyrillic = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.CYRL, [{start:"\u0400", end:"\u04ff"}, {start:"0", end:"9"}], goog.ime.lang.Script.DELIMITER_CHARS, {fontSize:14, lineHeight:1.5, minTextEditHeight:24});
var JSCompiler_temp_const$$19 = goog.ime.lang.languages, JSCompiler_inline_result$$75;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.CYRL, goog.ime.lang.scripts.Cyrillic);
var russian$$inline_76 = new goog.ime.lang.Language("RUSSIAN", goog.ime.lang.LanguageCode.RUSSIAN, "Russian", goog.ime.lang.scripts.Cyrillic);
JSCompiler_inline_result$$75 = russian$$inline_76;
JSCompiler_temp_const$$19.Russian = JSCompiler_inline_result$$75;
var JSCompiler_temp_const$$16 = goog.ime.lang.languages, JSCompiler_inline_result$$78;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.DEVA, goog.ime.lang.scripts.Devanagari);
var sanskrit$$inline_79 = new goog.ime.lang.Language("SANSKRIT", goog.ime.lang.LanguageCode.SANSKRIT, "Sanskrit", goog.ime.lang.scripts.Devanagari);
JSCompiler_inline_result$$78 = sanskrit$$inline_79;
JSCompiler_temp_const$$16.Sanskrit = JSCompiler_inline_result$$78;
var JSCompiler_temp_const$$17 = goog.ime.lang.languages, JSCompiler_inline_result$$81;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.CYRL, goog.ime.lang.scripts.Cyrillic);
var serbian$$inline_82 = new goog.ime.lang.Language("SERBIAN", goog.ime.lang.LanguageCode.SERBIAN, "Serbian", goog.ime.lang.scripts.Cyrillic);
JSCompiler_inline_result$$81 = serbian$$inline_82;
JSCompiler_temp_const$$17.Serbian = JSCompiler_inline_result$$81;
goog.ime.lang.scripts.SimplifiedHan = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.HANS, [{start:"\u4e00", end:"\u9fff"}], goog.ime.lang.Script.DELIMITER_CHARS);
var JSCompiler_temp_const$$15 = goog.ime.lang.languages, JSCompiler_inline_result$$84;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.HANS, goog.ime.lang.scripts.SimplifiedHan);
var chinese$$inline_85 = new goog.ime.lang.Language("CHINESE", goog.ime.lang.LanguageCode.SIMPLIFIED_CHINESE, "Chinese", goog.ime.lang.scripts.SimplifiedHan, "Pinyin");
JSCompiler_inline_result$$84 = chinese$$inline_85;
JSCompiler_temp_const$$15.SimplifiedChinese = JSCompiler_inline_result$$84;
goog.ime.lang.scripts.Sinhalese = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.SINH, [{start:"\u0d80", end:"\u0dff"}, {start:"\u200c", end:"\u200d"}, {start:"0", end:"9"}], goog.ime.lang.Script.DELIMITER_CHARS, {fontSize:14, lineHeight:1.5, minTextEditHeight:24});
var JSCompiler_temp_const$$25 = goog.ime.lang.languages, JSCompiler_inline_result$$87;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.SINH, goog.ime.lang.scripts.Sinhalese);
var sinhalese$$inline_88 = new goog.ime.lang.Language("SINHALESE", goog.ime.lang.LanguageCode.SINHALESE, "Sinhalese", goog.ime.lang.scripts.Sinhalese);
JSCompiler_inline_result$$87 = sinhalese$$inline_88;
JSCompiler_temp_const$$25.Sinhalese = JSCompiler_inline_result$$87;
goog.ime.lang.scripts.Tamil = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.TAML, [{start:"\u0b80", end:"\u0bff"}], goog.ime.lang.Script.DELIMITER_CHARS, {fontSize:14, lineHeight:1.5, minTextEditHeight:24});
var JSCompiler_temp_const$$24 = goog.ime.lang.languages, JSCompiler_inline_result$$90;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.TAML, goog.ime.lang.scripts.Tamil);
var tamil$$inline_91 = new goog.ime.lang.Language("TAMIL", goog.ime.lang.LanguageCode.TAMIL, "Tamil", goog.ime.lang.scripts.Tamil);
JSCompiler_inline_result$$90 = tamil$$inline_91;
JSCompiler_temp_const$$24.Tamil = JSCompiler_inline_result$$90;
goog.ime.lang.scripts.Telugu = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.TELU, [{start:"\u0c00", end:"\u0c7f"}], goog.ime.lang.Script.DELIMITER_CHARS, {fontSize:16, lineHeight:1.8, minTextEditHeight:28});
var JSCompiler_temp_const$$0 = goog.ime.lang.languages, JSCompiler_inline_result$$93;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.TELU, goog.ime.lang.scripts.Telugu);
var telugu$$inline_94 = new goog.ime.lang.Language("TELUGU", goog.ime.lang.LanguageCode.TELUGU, "Telugu", goog.ime.lang.scripts.Telugu);
JSCompiler_inline_result$$93 = telugu$$inline_94;
JSCompiler_temp_const$$0.Telugu = JSCompiler_inline_result$$93;
var JSCompiler_temp_const$$1 = goog.ime.lang.languages, JSCompiler_inline_result$$96;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.ETHI, goog.ime.lang.scripts.Ethiopic);
var tigrinya$$inline_97 = new goog.ime.lang.Language("TIGRINYA", goog.ime.lang.LanguageCode.TIGRINYA, "Tigrinya", goog.ime.lang.scripts.Ethiopic);
JSCompiler_inline_result$$96 = tigrinya$$inline_97;
JSCompiler_temp_const$$1.Tigrinya = JSCompiler_inline_result$$96;
goog.ime.lang.scripts.TranditionalHan = new goog.ime.lang.Script(goog.ime.lang.ScriptCode.HANT, [{start:"\u4e00", end:"\u9fff"}], goog.ime.lang.Script.DELIMITER_CHARS);
var JSCompiler_temp_const$$2 = goog.ime.lang.languages, JSCompiler_inline_result$$99;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.HANT, goog.ime.lang.scripts.TranditionalHan);
var hant$$inline_100 = new goog.ime.lang.Language("TRANDITIONAL CHINESE", goog.ime.lang.LanguageCode.TRADITIONAL_CHINESE, "Traditional Chinese", goog.ime.lang.scripts.TranditionalHan, "Zhuyin");
JSCompiler_inline_result$$99 = hant$$inline_100;
JSCompiler_temp_const$$2.TraditionalChinese = JSCompiler_inline_result$$99;
var JSCompiler_temp_const$$3 = goog.ime.lang.languages, JSCompiler_inline_result$$102;
goog.ime.lang.Script.define(goog.ime.lang.ScriptCode.ARAB, goog.ime.lang.scripts.Arabic);
var urdu$$inline_103 = new goog.ime.lang.Language("URDU", goog.ime.lang.LanguageCode.URDU, "Urdu", goog.ime.lang.scripts.Arabic);
JSCompiler_inline_result$$102 = urdu$$inline_103;
JSCompiler_temp_const$$3.Urdu = JSCompiler_inline_result$$102;
goog.ime.lang.languages.Vietnamese = new goog.ime.lang.Language("VIETNAMESE", goog.ime.lang.LanguageCode.VIETNAMESE, "Vietnamese", goog.ime.lang.scripts.Latin);
goog.ime.lang.inited_ = !1;
goog.ime.lang.init = function $goog$ime$lang$init$() {
  goog.ime.lang.inited_ || (goog.ime.lang.inited_ = !0, goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.languages.English), -1 != EnabledLanguages.indexOf("am") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.AMHARIC, goog.ime.lang.languages.Amharic), -1 != EnabledLanguages.indexOf("ar") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.ARABIC, goog.ime.lang.languages.Arabic), -1 != EnabledLanguages.indexOf("bn") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.BENGALI, 
  goog.ime.lang.languages.Bengali), -1 != EnabledLanguages.indexOf("zh-hans") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.SIMPLIFIED_CHINESE, goog.ime.lang.languages.SimplifiedChinese), -1 != EnabledLanguages.indexOf("el") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.GREEK, goog.ime.lang.languages.Greek), -1 != EnabledLanguages.indexOf("gu") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.GUJARATI, goog.ime.lang.languages.Gujarati), -1 != EnabledLanguages.indexOf("iw") && 
  goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.HEBREW, goog.ime.lang.languages.Hebrew), -1 != EnabledLanguages.indexOf("he") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.HEBREW, goog.ime.lang.languages.Hebrew), -1 != EnabledLanguages.indexOf("hi") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.HINDI, goog.ime.lang.languages.Hindi), -1 != EnabledLanguages.indexOf("ja") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.JAPANESE, goog.ime.lang.languages.Japanese), 
  -1 != EnabledLanguages.indexOf("kn") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.KANNADA, goog.ime.lang.languages.Kannada), -1 != EnabledLanguages.indexOf("ml") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.MALAYALAM, goog.ime.lang.languages.Malayalam), -1 != EnabledLanguages.indexOf("mr") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.MARATHI, goog.ime.lang.languages.Marathi), -1 != EnabledLanguages.indexOf("ne") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.NEPALI, 
  goog.ime.lang.languages.Nepali), -1 != EnabledLanguages.indexOf("or") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.ORIYA, goog.ime.lang.languages.Oriya), -1 != EnabledLanguages.indexOf("fa") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.PERSIAN, goog.ime.lang.languages.Persian), -1 != EnabledLanguages.indexOf("pa") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.PUNJABI, goog.ime.lang.languages.Punjabi), -1 != EnabledLanguages.indexOf("ru") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.RUSSIAN, 
  goog.ime.lang.languages.Russian), -1 != EnabledLanguages.indexOf("sa") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.SANSKRIT, goog.ime.lang.languages.Sanskrit), -1 != EnabledLanguages.indexOf("sr") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.SERBIAN, goog.ime.lang.languages.Serbian), -1 != EnabledLanguages.indexOf("si") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.SINHALESE, goog.ime.lang.languages.Sinhalese), -1 != EnabledLanguages.indexOf("ta") && 
  goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.TAMIL, goog.ime.lang.languages.Tamil), -1 != EnabledLanguages.indexOf("te") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.TELUGU, goog.ime.lang.languages.Telugu), -1 != EnabledLanguages.indexOf("ti") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.TIGRINYA, goog.ime.lang.languages.Tigrinya), -1 != EnabledLanguages.indexOf("ur") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.URDU, goog.ime.lang.languages.Urdu), 
  -1 != EnabledLanguages.indexOf("vi") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.VIETNAMESE, goog.ime.lang.languages.Vietnamese), -1 != EnabledLanguages.indexOf("zh-hant") && goog.ime.lang.Language.define(goog.ime.lang.LanguageCode.TRADITIONAL_CHINESE, goog.ime.lang.languages.TraditionalChinese))
};
goog.functions = {};
goog.functions.constant = function $goog$functions$constant$(retValue) {
  return function() {
    return retValue
  }
};
goog.functions.FALSE = goog.functions.constant(!1);
goog.functions.TRUE = goog.functions.constant(!0);
goog.functions.NULL = goog.functions.constant(null);
goog.functions.identity = function $goog$functions$identity$(opt_returnValue) {
  return opt_returnValue
};
goog.functions.error = function $goog$functions$error$(message) {
  return function() {
    throw Error(message);
  }
};
goog.functions.lock = function $goog$functions$lock$(f) {
  return function() {
    return f.call(this)
  }
};
goog.functions.withReturnValue = function $goog$functions$withReturnValue$(f, retValue) {
  return goog.functions.sequence(f, goog.functions.constant(retValue))
};
goog.functions.compose = function $goog$functions$compose$(var_args) {
  var functions = arguments, length = functions.length;
  return function() {
    var result;
    length && (result = functions[length - 1].apply(this, arguments));
    for(var i = length - 2;0 <= i;i--) {
      result = functions[i].call(this, result)
    }
    return result
  }
};
goog.functions.sequence = function $goog$functions$sequence$(var_args) {
  var functions = arguments, length = functions.length;
  return function() {
    for(var result, i = 0;i < length;i++) {
      result = functions[i].apply(this, arguments)
    }
    return result
  }
};
goog.functions.and = function $goog$functions$and$(var_args) {
  var functions = arguments, length = functions.length;
  return function() {
    for(var i = 0;i < length;i++) {
      if(!functions[i].apply(this, arguments)) {
        return!1
      }
    }
    return!0
  }
};
goog.functions.or = function $goog$functions$or$(var_args) {
  var functions = arguments, length = functions.length;
  return function() {
    for(var i = 0;i < length;i++) {
      if(functions[i].apply(this, arguments)) {
        return!0
      }
    }
    return!1
  }
};
goog.functions.not = function $goog$functions$not$(f) {
  return function() {
    return!f.apply(this, arguments)
  }
};
goog.functions.create = function $goog$functions$create$(constructor, var_args) {
  var temp = function $temp$() {
  };
  temp.prototype = constructor.prototype;
  var obj = new temp;
  constructor.apply(obj, Array.prototype.slice.call(arguments, 1));
  return obj
};
goog.ime.plugin.TransformationPlugin = function $goog$ime$plugin$TransformationPlugin$() {
  this.currentInputTool = null;
  this.active = !1;
  this.currentTextInput = null;
  goog.ime.lang.init();
  goog.Disposable.call(this)
};
goog.inherits(goog.ime.plugin.TransformationPlugin, goog.Disposable);
goog.ime.plugin.TransformationPlugin.prototype.isSupportedCommand = function $goog$ime$plugin$TransformationPlugin$$isSupportedCommand$(cmd) {
  return goog.array.contains([goog.ime.plugin.CommandType.CHANGE_STATE, goog.ime.plugin.CommandType.CHANGE_DIRECTION], cmd)
};
goog.ime.plugin.TransformationPlugin.prototype.execCommand = function $goog$ime$plugin$TransformationPlugin$$execCommand$(command, var_args) {
  if(this.isSupportedCommand(command)) {
    var args = goog.array.clone(arguments);
    this.execCommandInternal.apply(this, args)
  }
};
goog.ime.plugin.TransformationPlugin.prototype.execCommandInternal = function $goog$ime$plugin$TransformationPlugin$$execCommandInternal$(cmd, var_args, JSCompiler_OptimizeArgumentsArray_p0) {
  switch(cmd) {
    case goog.ime.plugin.CommandType.CHANGE_STATE:
      this.currentInputTool = var_args;
      this.active = JSCompiler_OptimizeArgumentsArray_p0;
      break;
    case goog.ime.plugin.CommandType.CHANGE_DIRECTION:
      if(this.currentTextInput) {
        var dir = var_args;
        this.currentTextInput.maybeChangeDirection(dir)
      }
  }
};
goog.ime.plugin.TransformationPlugin.prototype.handleShortcut = goog.functions.FALSE;
goog.ime.plugin.TransformationPlugin.prototype.handleEvent = function $goog$ime$plugin$TransformationPlugin$$handleEvent$(textInput, e) {
  this.currentTextInput = textInput;
  return this.currentInputTool && this.currentTextInput && this.active && goog.array.contains(this.getEventTypes(), e.type) && this.isSupportedInputTool(this.currentInputTool) ? this.handleEventInternal(textInput, e) : !1
};
goog.ime.plugin.TransformationPlugin.prototype.isSupportedInputTool = goog.functions.FALSE;
goog.ime.plugin.TransformationPlugin.prototype.register = function $goog$ime$plugin$TransformationPlugin$$register$() {
};
goog.ime.plugin.TransformationPlugin.prototype.unregister = function $goog$ime$plugin$TransformationPlugin$$unregister$() {
  this.currentTextInput = null
};
goog.ime.plugin.TransformationPlugin.prototype.getCurrentInputTool = function $goog$ime$plugin$TransformationPlugin$$getCurrentInputTool$() {
  return this.currentInputTool
};
goog.ime.plugin.TransformationPlugin.prototype.isActive = function $goog$ime$plugin$TransformationPlugin$$isActive$() {
  return this.active
};
goog.ime.plugin.TransformationPlugin.prototype.disposeInternal = function $goog$ime$plugin$TransformationPlugin$$disposeInternal$() {
};
goog.ime.api = {};
goog.ime.api.ita = {};
goog.ime.api.ita.DocumentReplacer = {};
goog.ime.api.ita.DocumentReplacer.document_ = window.document;
goog.ime.api.ita.DocumentReplacer.window_ = window;
goog.ime.api.ita.DocumentReplacer.domHelper_ = goog.dom.getDomHelper(window.document);
goog.ime.api.ita.DocumentReplacer.setDocument = function $goog$ime$api$ita$DocumentReplacer$setDocument$(doc) {
  goog.ime.api.ita.DocumentReplacer.document_ = doc;
  goog.ime.api.ita.DocumentReplacer.domHelper_ = goog.dom.getDomHelper(doc)
};
goog.ime.api.ita.DocumentReplacer.getDocument = function $goog$ime$api$ita$DocumentReplacer$getDocument$() {
  return goog.ime.api.ita.DocumentReplacer.document_
};
goog.ime.api.ita.DocumentReplacer.getDomHelper = function $goog$ime$api$ita$DocumentReplacer$getDomHelper$() {
  return goog.ime.api.ita.DocumentReplacer.domHelper_
};
goog.ime.api.ita.DocumentReplacer.setWindow = function $goog$ime$api$ita$DocumentReplacer$setWindow$(win) {
  win && (goog.ime.api.ita.DocumentReplacer.window_ = win, goog.ime.api.ita.DocumentReplacer.setDocument(win.document))
};
goog.ime.api.ita.DocumentReplacer.getWindow = function $goog$ime$api$ita$DocumentReplacer$getWindow$() {
  return goog.ime.api.ita.DocumentReplacer.window_
};
goog.ime.plugin.keyboard = {};
goog.ime.plugin.keyboard.KeyboardInput = function $goog$ime$plugin$keyboard$KeyboardInput$() {
  this.currentTextInput_ = null
};
goog.ime.plugin.keyboard.KeyboardInput.prototype.getTextBeforeCaret = function $goog$ime$plugin$keyboard$KeyboardInput$$getTextBeforeCaret$(opt_maxLength) {
  var textInput = this.currentTextInput_;
  if(!textInput) {
    return""
  }
  var text = "", maxLength = opt_maxLength ? opt_maxLength : 20;
  if(textInput.controlType == goog.ime.dom.InputType.CUSTOMIZED) {
    text = textInput.getTextBeforeCaret(maxLength)
  }else {
    var doc = textInput.getDomHelper().getDocument();
    if(doc.selection) {
      var range = doc.selection.createRange();
      range.collapse(!0);
      range.moveStart("sentence", -1);
      text = range.text
    }else {
      if(textInput.controlType == goog.ime.dom.InputType.TEXTEDIT) {
        var elem = textInput.getEditableElement(), text = elem.value.slice(Math.max(0, elem.selectionStart - maxLength), elem.selectionStart)
      }else {
        var sel = textInput.getDomHelper().getWindow().getSelection(), node = sel.getRangeAt(0).startContainer, offset = sel.getRangeAt(0).startOffset;
        node.nodeType == goog.dom.NodeType.TEXT && (text = node.nodeValue.slice(Math.max(0, offset - maxLength), offset))
      }
    }
  }
  return text
};
goog.ime.plugin.keyboard.KeyboardInput.prototype.commitTextForIE_ = function $goog$ime$plugin$keyboard$KeyboardInput$$commitTextForIE_$(text, back) {
  var doc = this.currentTextInput_.getDomHelper().getDocument(), range = doc.selection.createRange();
  0 < back && (text || !range.text) && range.moveStart("character", -back);
  (0 < back || range.text) && range.execCommand("delete", !1, null);
  if((" " == text.charAt(0) || " " == text.charAt(text.length - 1)) && this.currentTextInput_.controlType == goog.ime.dom.InputType.RICHEDIT) {
    var elementRange = range.duplicate();
    elementRange.moveToElementText(range.parentElement());
    var backupRange = range.duplicate();
    if(" " == text.charAt(0)) {
      if(range.moveStart("character", -1), elementRange.inRange(range)) {
        var extendedChar = range.text.charAt(0), text = (" " == extendedChar ? "\u00a0" : extendedChar) + text
      }else {
        range = backupRange
      }
    }
    backupRange = range.duplicate();
    " " == text.charAt(text.length - 1) && (range.moveEnd("character", 1), elementRange.inRange(range) && (extendedChar = range.text.charAt(range.text.length - 1), " " == extendedChar && (text = text.slice(0, text.length - 1) + "\u00a0")), range = backupRange)
  }
  range.text = text;
  range.collapse(!1);
  range.select()
};
goog.ime.plugin.keyboard.KeyboardInput.prototype.commitTextForPlainText_ = function $goog$ime$plugin$keyboard$KeyboardInput$$commitTextForPlainText_$(text, back) {
  var elem = this.currentTextInput_.getEditableElement(), from = elem.selectionStart, to = elem.selectionEnd;
  !text && from < to && (back = 0);
  from -= Math.min(from, back);
  elem.value = elem.value.slice(0, from) + text + elem.value.slice(to);
  from += text.length;
  elem.setSelectionRange(from, from)
};
goog.ime.plugin.keyboard.KeyboardInput.prototype.commitTextForRichText_ = function $goog$ime$plugin$keyboard$KeyboardInput$$commitTextForRichText_$(text, back) {
  var win = this.currentTextInput_.getDomHelper().getWindow(), doc = win.document, sel = win.getSelection();
  sel.isCollapsed || (doc.execCommand("delete", !1, null), text || (back = 0));
  for(var i = 0;i < back;++i) {
    doc.execCommand("delete", !1, null)
  }
  if(text) {
    var dealWithSpaces = !1;
    if(sel.anchorNode.nodeType == goog.dom.NodeType.TEXT) {
      var node = sel.anchorNode, nodeText = node.nodeValue, start, end;
      start = end = sel.anchorOffset;
      for(var whitespaces = [" ", "\u00a0"];0 < start && goog.array.contains(whitespaces, nodeText[--start]);) {
      }
      for(;end < nodeText.length && goog.array.contains(whitespaces, nodeText[end++]);) {
      }
      if(" " == text.charAt(0) || " " == text.charAt(text.length - 1) || nodeText.slice(start, end)) {
        var newCaretPos = sel.anchorOffset + text.length, text = nodeText.slice(start, sel.anchorOffset) + text + nodeText.slice(sel.anchorOffset, end), text = text.replace(/\u00a0/g, " "), text = text.replace(/^\u0020/g, "\u00a0"), text = text.replace(/\u0020{2}/g, " \u00a0"), text = text.replace(/\u0020$/g, "\u00a0");
        node.nodeValue = nodeText.slice(0, start) + text + nodeText.slice(end);
        var range = doc.createRange();
        range.setStart(node, newCaretPos);
        range.collapse(!0);
        sel.removeAllRanges();
        sel.addRange(range);
        dealWithSpaces = !0
      }
    }else {
      text = text.replace(/ /g, "\u00a0")
    }
    dealWithSpaces || doc.execCommand("insertHTML", !1, text)
  }
};
goog.ime.plugin.keyboard.KeyboardInput.prototype.commitText = function $goog$ime$plugin$keyboard$KeyboardInput$$commitText$(text, opt_back) {
  var back = opt_back ? opt_back : 0, textInput = this.currentTextInput_;
  textInput && (textInput.setFocus(), textInput.controlType == goog.ime.dom.InputType.CUSTOMIZED ? textInput.commitText(text, back) : textInput.getDomHelper().getDocument().selection ? this.commitTextForIE_(text, back) : textInput.controlType == goog.ime.dom.InputType.TEXTEDIT ? this.commitTextForPlainText_(text, back) : this.commitTextForRichText_(text, back), goog.ime.plugin.EventUtil.sendFakeKeyUp(textInput.getEditableElement(), goog.events.KeyCodes.SHIFT))
};
goog.ime.plugin.keyboard.KeyboardInput.prototype.getCaretPosition = function $goog$ime$plugin$keyboard$KeyboardInput$$getCaretPosition$() {
  throw Error("not supported");
};
goog.ime.plugin.keyboard.KeyboardInput.prototype.setFocus = function $goog$ime$plugin$keyboard$KeyboardInput$$setFocus$() {
  this.currentTextInput_ && this.currentTextInput_.setFocus()
};
goog.ime.plugin.keyboard.KeyboardInput.prototype.setCurrentTextInput = function $goog$ime$plugin$keyboard$KeyboardInput$$setCurrentTextInput$(textInput) {
  this.currentTextInput_ = textInput
};
goog.ime.plugin.keyboard.KeyboardPlugin = function $goog$ime$plugin$keyboard$KeyboardPlugin$() {
  goog.ime.plugin.TransformationPlugin.call(this);
  this.controller_ = goog.ime.keyboard.Controller.getInstance();
  this.keyboardInput_ = new goog.ime.plugin.keyboard.KeyboardInput;
  this.initialize_()
};
goog.inherits(goog.ime.plugin.keyboard.KeyboardPlugin, goog.ime.plugin.TransformationPlugin);
goog.ime.plugin.keyboard.KeyboardPlugin.prototype.isSupportedCommand = function $goog$ime$plugin$keyboard$KeyboardPlugin$$isSupportedCommand$(cmd) {
  return!!cmd && goog.array.contains([goog.ime.plugin.CommandType.CHANGE_STATE, goog.ime.plugin.CommandType.CHANGE_DIRECTION, goog.ime.plugin.CommandType.SHOW_KEYBOARD, goog.ime.plugin.CommandType.LOAD_LAYOUT], cmd)
};
goog.ime.plugin.keyboard.KeyboardPlugin.prototype.isSupportedInputTool = function $goog$ime$plugin$keyboard$KeyboardPlugin$$isSupportedInputTool$(inputTool) {
  return!!inputTool && inputTool.type == goog.ime.lang.InputToolType.KBD
};
goog.ime.plugin.keyboard.EventType = {CLOSE_KEYBOARD:"ck"};
goog.ime.plugin.keyboard.KeyboardPlugin.prototype.initialize_ = function $goog$ime$plugin$keyboard$KeyboardPlugin$$initialize_$() {
  this.controller_.setInputable(this.keyboardInput_);
  this.controller_.setDomHelper(goog.ime.api.ita.DocumentReplacer.getDomHelper());
  this.controller_.setAppName(goog.ime.plugin.lang.TranslitQuery.applicationName);
  this.controller_.addEventListener(goog.ime.keyboard.EventType.KEYBOARD_CLOSED, this.onKeyboardClosed_, this)
};
goog.ime.plugin.keyboard.KeyboardPlugin.prototype.register = function $goog$ime$plugin$keyboard$KeyboardPlugin$$register$(textInput) {
  goog.ime.plugin.keyboard.KeyboardPlugin.superClass_.register.call(this, textInput);
  this.keyboardInput_.setCurrentTextInput(textInput);
  var containerElement = textInput.getContainerElement();
  containerElement.id || containerElement.setAttribute("id", goog.getUid(containerElement))
};
goog.ime.plugin.keyboard.KeyboardPlugin.prototype.getEventTypes = function $goog$ime$plugin$keyboard$KeyboardPlugin$$getEventTypes$() {
  return[goog.events.EventType.KEYDOWN, goog.events.EventType.KEYUP, goog.events.EventType.KEYPRESS, goog.events.EventType.FOCUS, goog.events.EventType.MOUSEDOWN]
};
goog.ime.plugin.keyboard.KeyboardPlugin.prototype.handleEventInternal = function $goog$ime$plugin$keyboard$KeyboardPlugin$$handleEventInternal$(textInput, e) {
  if(goog.ime.plugin.EventUtil.isFakeEvent(e)) {
    return!1
  }
  this.keyboardInput_.setCurrentTextInput(textInput);
  return this.controller_.handleEvent(e)
};
goog.ime.plugin.keyboard.KeyboardPlugin.prototype.execCommandInternal = function $goog$ime$plugin$keyboard$KeyboardPlugin$$execCommandInternal$(cmd, var_args) {
  var clazz = goog.ime.plugin.keyboard.KeyboardPlugin.superClass_;
  clazz.execCommandInternal.apply(this, arguments);
  this.currentTextInput && this.keyboardInput_.setCurrentTextInput(this.currentTextInput);
  switch(cmd) {
    case goog.ime.plugin.CommandType.CHANGE_STATE:
      var inputTool = arguments[1], enabled = arguments[2];
      inputTool || (inputTool = this.currentInputTool);
      this.isSupportedInputTool(inputTool) && inputTool.layoutCode ? (this.controller_.activateLayout(inputTool.layoutCode), this.controller_.setVisible(enabled)) : this.controller_.setVisible(!1);
      break;
    case goog.ime.plugin.CommandType.SHOW_KEYBOARD:
      var visible = arguments[1];
      this.controller_.setVisible(visible);
      break;
    case goog.ime.plugin.CommandType.LOAD_LAYOUT:
      var layoutCode = arguments[1];
      this.controller_.loadLayout(layoutCode)
  }
};
goog.ime.plugin.keyboard.KeyboardPlugin.prototype.onKeyboardClosed_ = function $goog$ime$plugin$keyboard$KeyboardPlugin$$onKeyboardClosed_$() {
  this.currentTextInput && this.currentTextInput.dispatchEvent(new goog.events.Event(goog.ime.plugin.keyboard.EventType.CLOSE_KEYBOARD))
};
goog.positioning.AnchoredPosition = function $goog$positioning$AnchoredPosition$(anchorElement, corner, opt_overflow) {
  this.element = anchorElement;
  this.corner = corner;
  this.overflow_ = opt_overflow
};
goog.inherits(goog.positioning.AnchoredPosition, goog.positioning.AbstractPosition);
goog.positioning.AnchoredPosition.prototype.reposition = function $goog$positioning$AnchoredPosition$$reposition$(movableElement, movableCorner, opt_margin) {
  goog.positioning.positionAtAnchor(this.element, this.corner, movableElement, movableCorner, void 0, opt_margin, this.overflow_)
};
goog.ime.api.ita.MenuEventType = {ACTION:"action", BIND:"bind", VISIBILITY:"visi"};
goog.ime.api.ita.MenuBindEvent = function $goog$ime$api$ita$MenuBindEvent$(element) {
  goog.events.Event.call(this, goog.ime.api.ita.MenuEventType.BIND);
  this.element_ = element
};
goog.inherits(goog.ime.api.ita.MenuBindEvent, goog.events.Event);
goog.ime.api.ita.MenuBindEvent.prototype.getElement = function $goog$ime$api$ita$MenuBindEvent$$getElement$() {
  return this.element_
};
goog.ime.api.ita.MenuActionEvent = function $goog$ime$api$ita$MenuActionEvent$(inputTool, enabled) {
  goog.events.Event.call(this, goog.ime.api.ita.MenuEventType.ACTION);
  this.inputTool_ = inputTool;
  this.enabled_ = enabled
};
goog.inherits(goog.ime.api.ita.MenuActionEvent, goog.events.Event);
goog.ime.api.ita.MenuActionEvent.prototype.getInputTool = function $goog$ime$api$ita$MenuActionEvent$$getInputTool$() {
  return this.inputTool_
};
goog.ime.api.ita.MenuActionEvent.prototype.getEnabled = function $goog$ime$api$ita$MenuActionEvent$$getEnabled$() {
  return this.enabled_
};
goog.ime.api.ita.MenuVisibilityEvent = function $goog$ime$api$ita$MenuVisibilityEvent$(visible) {
  goog.events.Event.call(this, goog.ime.api.ita.MenuEventType.VISIBILITY);
  this.visible_ = visible
};
goog.inherits(goog.ime.api.ita.MenuVisibilityEvent, goog.events.Event);
goog.ime.api.ita.MenuVisibilityEvent.prototype.getVisible = function $goog$ime$api$ita$MenuVisibilityEvent$$getVisible$() {
  return this.visible_
};
goog.ime.api.ita.AbstractMenu = function $goog$ime$api$ita$AbstractMenu$() {
  goog.ui.Component.call(this, goog.ime.api.ita.DocumentReplacer.getDomHelper());
  this.isFloating = !1;
  this.activeElement_ = null;
  this.repositionEnabled_ = !0;
  this.display_ = "";
  this.dropdownMenuOpened = this.mouseInsideMenu = !1
};
goog.inherits(goog.ime.api.ita.AbstractMenu, goog.ui.Component);
goog.ime.api.ita.AbstractMenu.PositionType = {TOP_LEFT:[goog.positioning.Corner.TOP_LEFT, goog.positioning.Corner.BOTTOM_LEFT], TOP_RIGHT:[goog.positioning.Corner.TOP_RIGHT, goog.positioning.Corner.BOTTOM_RIGHT], UPPER_LEFT:[goog.positioning.Corner.TOP_LEFT, goog.positioning.Corner.BOTTOM_RIGHT], UPPER_RIGHT:[goog.positioning.Corner.TOP_RIGHT, goog.positioning.Corner.BOTTOM_LEFT], BOTTOM_LEFT:[goog.positioning.Corner.BOTTOM_LEFT, goog.positioning.Corner.TOP_LEFT], BOTTOM_RIGHT:[goog.positioning.Corner.BOTTOM_RIGHT, 
goog.positioning.Corner.TOP_RIGHT], LOWER_LEFT:[goog.positioning.Corner.BOTTOM_LEFT, goog.positioning.Corner.TOP_RIGHT], LOWER_RIGHT:[goog.positioning.Corner.BOTTOM_RIGHT, goog.positioning.Corner.TOP_LEFT], INNER_BOTTOM_END:[goog.positioning.Corner.BOTTOM_END, goog.positioning.Corner.BOTTOM_END], INNER_BOTTOM_START:[goog.positioning.Corner.BOTTOM_START, goog.positioning.Corner.BOTTOM_START], INNER_TOP_END:[goog.positioning.Corner.TOP_END, goog.positioning.Corner.TOP_END], INNER_TOP_START:[goog.positioning.Corner.TOP_START, 
goog.positioning.Corner.TOP_START], TOP_START:[goog.positioning.Corner.TOP_START, goog.positioning.Corner.BOTTOM_START], TOP_END:[goog.positioning.Corner.TOP_END, goog.positioning.Corner.BOTTOM_END], UPPER_START:[goog.positioning.Corner.TOP_START, goog.positioning.Corner.BOTTOM_END], UPPER_END:[goog.positioning.Corner.TOP_END, goog.positioning.Corner.BOTTOM_START], BOTTOM_START:[goog.positioning.Corner.BOTTOM_START, goog.positioning.Corner.TOP_START], BOTTOM_END:[goog.positioning.Corner.BOTTOM_END, 
goog.positioning.Corner.TOP_END], LOWER_START:[goog.positioning.Corner.BOTTOM_START, goog.positioning.Corner.TOP_END], LOWER_END:[goog.positioning.Corner.BOTTOM_END, goog.positioning.Corner.TOP_START]};
goog.ime.api.ita.AbstractMenu.POSITION_PAD = 10;
goog.ime.api.ita.AbstractMenu.prototype.redirectFocus = function $goog$ime$api$ita$AbstractMenu$$redirectFocus$() {
  if(this.activeElement_) {
    if("IFRAME" == this.activeElement_.tagName.toUpperCase()) {
      try {
        var ifwin = goog.dom.getFrameContentWindow(this.activeElement_);
        ifwin && ifwin.focus()
      }catch(e) {
      }
    }else {
      this.activeElement_.focus()
    }
  }
};
goog.ime.api.ita.AbstractMenu.prototype.setRepositionEnabled = function $goog$ime$api$ita$AbstractMenu$$setRepositionEnabled$(enabled) {
  this.repositionEnabled_ = enabled
};
goog.ime.api.ita.AbstractMenu.prototype.enterDocument = function $goog$ime$api$ita$AbstractMenu$$enterDocument$() {
  var container = this.getElement();
  goog.events.listen(container, goog.events.EventType.MOUSEOVER, function() {
    this.mouseInsideMenu = !0
  }, void 0, this);
  goog.events.listen(container, goog.events.EventType.MOUSEOUT, function() {
    this.mouseInsideMenu = !1
  }, void 0, this)
};
goog.ime.api.ita.AbstractMenu.prototype.renderSelf = function $goog$ime$api$ita$AbstractMenu$$renderSelf$(isFloating, opt_containerElement) {
  this.container = isFloating ? void 0 : this.getDomHelper().getElement(opt_containerElement);
  this.isFloating = isFloating;
  this.render(this.container);
  this.container || (isFloating && this.addFloatingBar(), this.addMovableAttributes(), this.positionSelf());
  this.display_ = this.getElement().style.display
};
goog.ime.api.ita.AbstractMenu.prototype.addMovableAttributes = function $goog$ime$api$ita$AbstractMenu$$addMovableAttributes$() {
  var element = this.getElement();
  element.style.position = "absolute"
};
goog.ime.api.ita.AbstractMenu.goToBottomRight = function $goog$ime$api$ita$AbstractMenu$goToBottomRight$(element) {
  if(element) {
    var viewPortSize = goog.dom.getViewportSize(), width = element.offsetWidth, height = element.offsetHeight;
    element.style.left = Math.floor(viewPortSize.width - width - goog.ime.api.ita.AbstractMenu.POSITION_PAD) + "px";
    element.style.top = Math.floor(viewPortSize.height - height - goog.ime.api.ita.AbstractMenu.POSITION_PAD) + "px"
  }
};
goog.ime.api.ita.AbstractMenu.prototype.bindElement = function $goog$ime$api$ita$AbstractMenu$$bindElement$(elem) {
  var element = this.getDomHelper().getElement(elem);
  this.activeElement_ != element && (this.activeElement_ = element, this.dispatchEvent(new goog.ime.api.ita.MenuBindEvent(element)))
};
goog.ime.api.ita.AbstractMenu.prototype.reposition = function $goog$ime$api$ita$AbstractMenu$$reposition$(anchor, position, opt_margin) {
  if(this.repositionEnabled_) {
    var anchorElem = goog.dom.getElement(anchor);
    if(anchorElem) {
      var margin = new goog.math.Box(0, 0, 0, 0);
      goog.isDefAndNotNull(opt_margin) && (goog.isNumber(opt_margin) ? margin = new goog.math.Box(opt_margin, opt_margin, opt_margin, opt_margin) : goog.isArrayLike(opt_margin) && 4 == opt_margin.length && (margin = new goog.math.Box(opt_margin[0], opt_margin[1], opt_margin[2], opt_margin[3])));
      var anchoredPosition = new goog.positioning.AnchoredPosition(anchorElem, position[0]);
      anchoredPosition.reposition(this.getElement(), position[1], margin)
    }
  }
};
goog.ime.api.ita.AbstractMenu.prototype.show = function $goog$ime$api$ita$AbstractMenu$$show$() {
  var container = this.getElement();
  container && container.style.display != this.display_ && (container.style.display = this.display_, this.dispatchEvent(new goog.ime.api.ita.MenuVisibilityEvent(!0)))
};
goog.ime.api.ita.AbstractMenu.prototype.hide = function $goog$ime$api$ita$AbstractMenu$$hide$() {
  var container = this.getElement();
  container && "none" != container.style.display && !this.mouseInsideMenu && !this.dropdownMenuOpened && (container.style.display = "none", this.dispatchEvent(new goog.ime.api.ita.MenuVisibilityEvent(!1)))
};
goog.ime.api.ita.AbstractMenu.prototype.toggle = function $goog$ime$api$ita$AbstractMenu$$toggle$() {
  var container = this.getElement();
  if(container) {
    switch(container.style.display) {
      case this.display_:
        this.hide();
        break;
      case "none":
        this.show()
    }
  }
};
goog.ime.api.ita.AbstractMenu.prototype.getActiveElement = function $goog$ime$api$ita$AbstractMenu$$getActiveElement$() {
  return this.activeElement_
};
goog.ime.api.ita.ControlEventType = {STATUS_BAR:"sb", WIDGET:"wg", CURRENT_INPUT_TOOL_CHANGED:"citc", INPUT_TOOL_LIST_UPDATED:"itlu", PAGE_ELEMENT_LIST_UPDATED:"pelu", EXECUTE_COMMAND:"ecd"};
goog.ime.api.ita.StatusBarEvent = function $goog$ime$api$ita$StatusBarEvent$(commandType, inputTool, opt_value, opt_element) {
  goog.events.Event.call(this, goog.ime.api.ita.ControlEventType.STATUS_BAR);
  this.commandType = commandType;
  this.inputTool = inputTool;
  this.value = opt_value;
  this.element = opt_element
};
goog.inherits(goog.ime.api.ita.StatusBarEvent, goog.events.Event);
goog.ime.plugin.lang.ApplicationCode = {BLOGGER:0, ORKUT:1, TESTING:2, LABS:3, GMAIL:5, GTRANS:6, BUZZBOT:7, API:8, KNOL:9};
goog.ime.plugin.functions = {};
goog.ime.plugin.functions.sequence = function $goog$ime$plugin$functions$sequence$(objects, method, var_args) {
  var args = goog.array.slice(arguments, 2), result = [];
  goog.array.forEach(objects, function(plugin) {
    var prototypeMethod = goog.isFunction(method) ? method : plugin[method];
    result.push(prototypeMethod.apply(plugin, args))
  });
  return result
};
goog.ime.plugin.functions.or = function $goog$ime$plugin$functions$or$(objects, method, var_args) {
  for(var args = goog.array.slice(arguments, 2), length = objects.length, i = 0;i < length;i++) {
    var plugin = objects[i], prototypeMethod = goog.isFunction(method) ? method : plugin[method];
    if(prototypeMethod.apply(plugin, args)) {
      return!0
    }
  }
  return!1
};
goog.ime.plugin.functions.callUntilTrue = goog.ime.plugin.functions.or;
goog.ime.plugin.functions.bind = function $goog$ime$plugin$functions$bind$(fn, selfObj, var_args) {
  var context = selfObj || goog.global;
  if(2 < arguments.length) {
    var boundArgs = goog.array.slice(arguments, 2);
    return function() {
      var newArgs = goog.array.clone(arguments), fnArgs = goog.array.clone(boundArgs);
      goog.array.forEach(fnArgs, function(arg, i, args) {
        "undefined" == typeof arg && newArgs.length && (args[i] = newArgs.shift())
      });
      newArgs.length && goog.array.extend(fnArgs, newArgs);
      return fn.apply(context, newArgs)
    }
  }
  return function() {
    return fn.apply(context, arguments)
  }
};
goog.ime.plugin.lang.CompositeTranslitPlugin = function $goog$ime$plugin$lang$CompositeTranslitPlugin$(delegateBuilders) {
  goog.ime.plugin.TransformationPlugin.call(this);
  this.delegatePlugins_ = goog.array.reduce(delegateBuilders, function(plugins, builder) {
    plugins.push(builder());
    return plugins
  }, [])
};
goog.inherits(goog.ime.plugin.lang.CompositeTranslitPlugin, goog.ime.plugin.TransformationPlugin);
goog.ime.plugin.lang.CompositeTranslitPlugin.Op = {REGISTER:3, UNREGISTER:4, IS_REGISTERED:5, EXEC_COMMAND:6, QUERY_COMMAND:7, IS_SUPPORTED_COMMAND:8, HANDLE_EVENT:9, EXEC_COMMAND_INTERNAL:10};
goog.ime.plugin.lang.CompositeTranslitPlugin.OPCODE = goog.object.transpose(goog.reflect.object(goog.ime.plugin.TransformationPlugin, {register:goog.ime.plugin.lang.CompositeTranslitPlugin.Op.REGISTER, unregister:goog.ime.plugin.lang.CompositeTranslitPlugin.Op.UNREGISTER, isRegistered:goog.ime.plugin.lang.CompositeTranslitPlugin.Op.IS_REGISTERED, execCommand:goog.ime.plugin.lang.CompositeTranslitPlugin.Op.EXEC_COMMAND, queryCommand:goog.ime.plugin.lang.CompositeTranslitPlugin.Op.QUERY_COMMAND, isSupportedCommand:goog.ime.plugin.lang.CompositeTranslitPlugin.Op.IS_SUPPORTED_COMMAND, 
handleEvent:goog.ime.plugin.lang.CompositeTranslitPlugin.Op.HANDLE_EVENT, execCommandInternal:goog.ime.plugin.lang.CompositeTranslitPlugin.Op.EXEC_COMMAND_INTERNAL}));
goog.ime.plugin.lang.CompositeTranslitPlugin.prototype.getEventTypes = function $goog$ime$plugin$lang$CompositeTranslitPlugin$$getEventTypes$() {
  var eventTypes = [];
  goog.array.forEach(this.delegatePlugins_, function(plugin) {
    goog.array.extend(eventTypes, plugin.getEventTypes())
  });
  goog.array.removeDuplicates(eventTypes);
  return eventTypes
};
goog.ime.plugin.lang.CompositeTranslitPlugin.prototype.register = function $goog$ime$plugin$lang$CompositeTranslitPlugin$$register$(host) {
  var opcode = goog.ime.plugin.lang.CompositeTranslitPlugin.OPCODE[goog.ime.plugin.lang.CompositeTranslitPlugin.Op.REGISTER];
  goog.ime.plugin.functions.sequence(this.delegatePlugins_, opcode, host)
};
goog.ime.plugin.lang.CompositeTranslitPlugin.prototype.unregister = function $goog$ime$plugin$lang$CompositeTranslitPlugin$$unregister$(host) {
  var opcode = goog.ime.plugin.lang.CompositeTranslitPlugin.OPCODE[goog.ime.plugin.lang.CompositeTranslitPlugin.Op.UNREGISTER];
  goog.ime.plugin.functions.sequence(this.delegatePlugins_, opcode, host)
};
goog.ime.plugin.lang.CompositeTranslitPlugin.prototype.handleEvent = function $goog$ime$plugin$lang$CompositeTranslitPlugin$$handleEvent$(textInput, e) {
  goog.ime.plugin.lang.CompositeTranslitPlugin.superClass_.handleEvent.call(this, textInput, e);
  var opcode = goog.ime.plugin.lang.CompositeTranslitPlugin.OPCODE[goog.ime.plugin.lang.CompositeTranslitPlugin.Op.HANDLE_EVENT];
  return goog.ime.plugin.functions.or(this.delegatePlugins_, opcode, textInput, e)
};
goog.ime.plugin.lang.CompositeTranslitPlugin.prototype.handleShortcut = function $goog$ime$plugin$lang$CompositeTranslitPlugin$$handleShortcut$(textInput, e) {
  var ret = !1;
  goog.array.forEach(this.delegatePlugins_, function(plugin) {
    ret = ret || plugin.handleShortcut(textInput, e)
  });
  return ret
};
goog.ime.plugin.lang.CompositeTranslitPlugin.prototype.execCommandInternal = function $goog$ime$plugin$lang$CompositeTranslitPlugin$$execCommandInternal$(cmd, var_args) {
  var clazz = goog.ime.plugin.lang.CompositeTranslitPlugin.superClass_;
  clazz.execCommandInternal.apply(this, Array.prototype.slice.call(arguments, 0));
  for(var opcode = goog.ime.plugin.lang.CompositeTranslitPlugin.OPCODE[goog.ime.plugin.lang.CompositeTranslitPlugin.Op.EXEC_COMMAND_INTERNAL], args = [this.delegatePlugins_, opcode], i = 0;i < arguments.length;++i) {
    args.push(arguments[i])
  }
  goog.ime.plugin.functions.sequence.apply(this, args)
};
goog.ime.plugin.lang.CompositeTranslitPlugin.prototype.isSupportedCommand = function $goog$ime$plugin$lang$CompositeTranslitPlugin$$isSupportedCommand$(cmd) {
  var opcode = goog.ime.plugin.lang.CompositeTranslitPlugin.OPCODE[goog.ime.plugin.lang.CompositeTranslitPlugin.Op.IS_SUPPORTED_COMMAND];
  return goog.ime.plugin.functions.or(this.delegatePlugins_, opcode, cmd)
};
goog.ime.configdef = {};
goog.ime.configdef.dummy = function $goog$ime$configdef$dummy$() {
};
var EnabledLanguages = "am,ar,bn,zh-hans,el,gu,iw,hi,ja,kn,ml,mr,ne,or,fa,pa,ru,sa,sr,si,ta,te,ti,ur,vi,zh-hant", ITA_FLAGS_DEBUG = goog.DEBUG;
goog.ime.plugin.lang.DataSourceConfig = function $goog$ime$plugin$lang$DataSourceConfig$(config) {
  var errCode = goog.ime.plugin.lang.DataSourceConfig.ERROR_CODE;
  ITA_FLAGS_DEBUG && (!goog.isDefAndNotNull(config.applicationCode) || !goog.object.containsValue(goog.ime.plugin.lang.ApplicationCode, config.applicationCode)) && this.raiseError(errCode.APP_CODE, config.applicationCode);
  this.applicationCode = config.applicationCode;
  this.securityToken = config.securityToken;
  this.maxFetchSuggestionsCount = this.getBoundedNumber(5, 5, 200, config.maxFetchSuggestionsCount);
  this.fetchSuggestionsCount = this.getBoundedNumber(5, 2, this.maxFetchSuggestionsCount, config.fetchSuggestionsCount);
  this.fetchSuggestionsInc = this.getBoundedNumber(5, 5, this.maxFetchSuggestionsCount - this.fetchSuggestionsCount, config.fetchSuggestionsInc);
  this.textChangeInterval = this.getBoundedNumber(100, 50, 500, config.textChangeInterval)
};
goog.ime.plugin.lang.DataSourceConfig.prototype.raiseError = function $goog$ime$plugin$lang$DataSourceConfig$$raiseError$(errorCode, data) {
  var dataStr = goog.string.makeSafe(data);
  if(ITA_FLAGS_DEBUG) {
    var err = Error(errorCode + " : " + dataStr);
    err.code = errorCode;
    err.data = data;
    throw err;
  }
};
goog.ime.plugin.lang.DataSourceConfig.prototype.getBoundedNumber = function $goog$ime$plugin$lang$DataSourceConfig$$getBoundedNumber$(defNum, min, max, opt_num) {
  return goog.isNumber(opt_num) && opt_num >= min && opt_num <= max ? opt_num : defNum
};
ITA_FLAGS_DEBUG && (goog.ime.plugin.lang.DataSourceConfig.ERROR_CODE = {APP_CODE:"Invalid applicationCode property"});
goog.ime.lang.InputToolConfig = function $goog$ime$lang$InputToolConfig$(opt_sugCount, opt_maxLen) {
  this.showSuggestionCount = opt_sugCount ? opt_sugCount : 5;
  this.maxInputLength = opt_maxLen ? opt_maxLen : 50
};
goog.ime.lang.InputToolConfig.defaultInstance_ = new goog.ime.lang.InputToolConfig;
goog.ime.lang.InputToolConfig.configMap_ = {};
goog.ime.lang.InputToolConfig.get = function $goog$ime$lang$InputToolConfig$get$(opt_inputTool) {
  var config = null;
  opt_inputTool && (config = goog.ime.lang.InputToolConfig.configMap_[opt_inputTool.code]);
  config || (config = goog.ime.lang.InputToolConfig.defaultInstance_);
  return config
};
goog.ime.plugin.EventType = {PRECOMMIT_EVENT:"pce", TEXTCHANGED_EVENT:"tce", PRECOMMITTIMER_EVENT:"pte"};
goog.ime.plugin.PreCommitEvent = function $goog$ime$plugin$PreCommitEvent$(query, opt_commit) {
  goog.events.Event.call(this, goog.ime.plugin.EventType.PRECOMMIT_EVENT);
  this.query = query;
  this.commit = opt_commit || ""
};
goog.inherits(goog.ime.plugin.PreCommitEvent, goog.events.Event);
goog.ime.plugin.TextChangedEvent = function $goog$ime$plugin$TextChangedEvent$() {
  goog.events.Event.call(this, goog.ime.plugin.EventType.TEXTCHANGED_EVENT)
};
goog.inherits(goog.ime.plugin.TextChangedEvent, goog.events.Event);
goog.ime.plugin.PreCommitTimerEvent = function $goog$ime$plugin$PreCommitTimerEvent$(start) {
  goog.events.Event.call(this, goog.ime.plugin.EventType.PRECOMMITTIMER_EVENT);
  this.start = start
};
goog.inherits(goog.ime.plugin.TextChangedEvent, goog.events.Event);
goog.ime.ui = {};
goog.ime.ui.PopupEditor = function $goog$ime$ui$PopupEditor$() {
};
goog.ime.ui.PopupEditor.EventType = {SUCCESS:"success", DISCARD:"discard", FETCH_SUGGESTIONS:"fetch"};
goog.ime.ui.PopupEditor.prototype.inCompositionState = goog.functions.FALSE;
goog.ime.ui.FetchSuggestionEvent = function $goog$ime$ui$FetchSuggestionEvent$(text, minSuggestions) {
  goog.events.Event.call(this, goog.ime.ui.PopupEditor.EventType.FETCH_SUGGESTIONS);
  this.text = text;
  this.minSuggestions = minSuggestions
};
goog.inherits(goog.ime.ui.FetchSuggestionEvent, goog.events.Event);
goog.ime.ui.FetchMultiSegmentSuggestionEvent = function $goog$ime$ui$FetchMultiSegmentSuggestionEvent$(segments, minSuggestions, opt_requestSegmentation) {
  goog.ime.ui.FetchSuggestionEvent.call(this, segments.join(","), minSuggestions);
  this.segments = segments;
  this.requestSegmentation = !!opt_requestSegmentation
};
goog.inherits(goog.ime.ui.FetchMultiSegmentSuggestionEvent, goog.ime.ui.FetchSuggestionEvent);
goog.structs = {};
goog.structs.Collection = function $goog$structs$Collection$() {
};
goog.iter = {};
goog.iter.StopIteration = "StopIteration" in goog.global ? goog.global.StopIteration : Error("StopIteration");
goog.iter.Iterator = function $goog$iter$Iterator$() {
};
goog.iter.Iterator.prototype.next = function $goog$iter$Iterator$$next$() {
  throw goog.iter.StopIteration;
};
goog.iter.Iterator.prototype.__iterator__ = function $goog$iter$Iterator$$__iterator__$() {
  return this
};
goog.iter.toIterator = function $goog$iter$toIterator$(iterable) {
  if(iterable instanceof goog.iter.Iterator) {
    return iterable
  }
  if("function" == typeof iterable.__iterator__) {
    return iterable.__iterator__(!1)
  }
  if(goog.isArrayLike(iterable)) {
    var i = 0, newIter = new goog.iter.Iterator;
    newIter.next = function $newIter$next$() {
      for(;;) {
        if(i >= iterable.length) {
          throw goog.iter.StopIteration;
        }
        if(i in iterable) {
          return iterable[i++]
        }
        i++
      }
    };
    return newIter
  }
  throw Error("Not implemented");
};
goog.iter.forEach = function $goog$iter$forEach$(iterable, f, opt_obj) {
  if(goog.isArrayLike(iterable)) {
    try {
      goog.array.forEach(iterable, f, opt_obj)
    }catch(ex) {
      if(ex !== goog.iter.StopIteration) {
        throw ex;
      }
    }
  }else {
    iterable = goog.iter.toIterator(iterable);
    try {
      for(;;) {
        f.call(opt_obj, iterable.next(), void 0, iterable)
      }
    }catch(ex$$0) {
      if(ex$$0 !== goog.iter.StopIteration) {
        throw ex$$0;
      }
    }
  }
};
goog.iter.filter = function $goog$iter$filter$(iterable, f, opt_obj) {
  var iterable = goog.iter.toIterator(iterable), newIter = new goog.iter.Iterator;
  newIter.next = function $newIter$next$() {
    for(;;) {
      var val = iterable.next();
      if(f.call(opt_obj, val, void 0, iterable)) {
        return val
      }
    }
  };
  return newIter
};
goog.iter.range = function $goog$iter$range$(startOrStop, opt_stop, opt_step) {
  var start = 0, stop = startOrStop, step = opt_step || 1;
  1 < arguments.length && (start = startOrStop, stop = opt_stop);
  if(0 == step) {
    throw Error("Range step argument must not be zero");
  }
  var newIter = new goog.iter.Iterator;
  newIter.next = function $newIter$next$() {
    if(step > 0 && start >= stop || step < 0 && start <= stop) {
      throw goog.iter.StopIteration;
    }
    var rv = start;
    start = start + step;
    return rv
  };
  return newIter
};
goog.iter.join = function $goog$iter$join$(iterable, deliminator) {
  return goog.iter.toArray(iterable).join(deliminator)
};
goog.iter.map = function $goog$iter$map$(iterable, f, opt_obj) {
  var iterable = goog.iter.toIterator(iterable), newIter = new goog.iter.Iterator;
  newIter.next = function $newIter$next$() {
    for(;;) {
      var val = iterable.next();
      return f.call(opt_obj, val, void 0, iterable)
    }
  };
  return newIter
};
goog.iter.reduce = function $goog$iter$reduce$(iterable, f, val$$0, opt_obj) {
  var rval = val$$0;
  goog.iter.forEach(iterable, function(val) {
    rval = f.call(opt_obj, rval, val)
  });
  return rval
};
goog.iter.some = function $goog$iter$some$(iterable, f, opt_obj) {
  iterable = goog.iter.toIterator(iterable);
  try {
    for(;;) {
      if(f.call(opt_obj, iterable.next(), void 0, iterable)) {
        return!0
      }
    }
  }catch(ex) {
    if(ex !== goog.iter.StopIteration) {
      throw ex;
    }
  }
  return!1
};
goog.iter.every = function $goog$iter$every$(iterable, f, opt_obj) {
  iterable = goog.iter.toIterator(iterable);
  try {
    for(;;) {
      if(!f.call(opt_obj, iterable.next(), void 0, iterable)) {
        return!1
      }
    }
  }catch(ex) {
    if(ex !== goog.iter.StopIteration) {
      throw ex;
    }
  }
  return!0
};
goog.iter.chain = function $goog$iter$chain$(var_args) {
  var args = arguments, length = args.length, i = 0, newIter = new goog.iter.Iterator;
  newIter.next = function $newIter$next$() {
    try {
      if(i >= length) {
        throw goog.iter.StopIteration;
      }
      var current = goog.iter.toIterator(args[i]);
      return current.next()
    }catch(ex) {
      if(ex !== goog.iter.StopIteration || i >= length) {
        throw ex;
      }
      i++;
      return this.next()
    }
  };
  return newIter
};
goog.iter.dropWhile = function $goog$iter$dropWhile$(iterable, f, opt_obj) {
  var iterable = goog.iter.toIterator(iterable), newIter = new goog.iter.Iterator, dropping = !0;
  newIter.next = function $newIter$next$() {
    for(;;) {
      var val = iterable.next();
      if(!dropping || !f.call(opt_obj, val, void 0, iterable)) {
        return dropping = !1, val
      }
    }
  };
  return newIter
};
goog.iter.takeWhile = function $goog$iter$takeWhile$(iterable, f, opt_obj) {
  var iterable = goog.iter.toIterator(iterable), newIter = new goog.iter.Iterator, taking = !0;
  newIter.next = function $newIter$next$() {
    for(;;) {
      if(taking) {
        var val = iterable.next();
        if(f.call(opt_obj, val, void 0, iterable)) {
          return val
        }
        taking = !1
      }else {
        throw goog.iter.StopIteration;
      }
    }
  };
  return newIter
};
goog.iter.toArray = function $goog$iter$toArray$(iterable) {
  if(goog.isArrayLike(iterable)) {
    return goog.array.toArray(iterable)
  }
  var iterable = goog.iter.toIterator(iterable), array = [];
  goog.iter.forEach(iterable, function(val) {
    array.push(val)
  });
  return array
};
goog.iter.equals = function $goog$iter$equals$(iterable1, iterable2) {
  var iterable1 = goog.iter.toIterator(iterable1), iterable2 = goog.iter.toIterator(iterable2), b1, b2;
  try {
    for(;;) {
      b1 = b2 = !1;
      var val1 = iterable1.next();
      b1 = !0;
      var val2 = iterable2.next();
      b2 = !0;
      if(val1 != val2) {
        break
      }
    }
  }catch(ex) {
    if(ex !== goog.iter.StopIteration) {
      throw ex;
    }
    if(b1 && !b2) {
      return!1
    }
    if(!b2) {
      try {
        iterable2.next()
      }catch(ex1) {
        if(ex1 !== goog.iter.StopIteration) {
          throw ex1;
        }
        return!0
      }
    }
  }
  return!1
};
goog.iter.nextOrValue = function $goog$iter$nextOrValue$(iterable, defaultValue) {
  try {
    return goog.iter.toIterator(iterable).next()
  }catch(e) {
    if(e != goog.iter.StopIteration) {
      throw e;
    }
    return defaultValue
  }
};
goog.iter.product = function $goog$iter$product$(var_args) {
  var someArrayEmpty = goog.array.some(arguments, function(arr) {
    return!arr.length
  });
  if(someArrayEmpty || !arguments.length) {
    return new goog.iter.Iterator
  }
  var iter = new goog.iter.Iterator, arrays = arguments, indicies = goog.array.repeat(0, arrays.length);
  iter.next = function $iter$next$() {
    if(indicies) {
      for(var retVal = goog.array.map(indicies, function(valueIndex, arrayIndex) {
        return arrays[arrayIndex][valueIndex]
      }), i = indicies.length - 1;0 <= i;i--) {
        goog.asserts.assert(indicies);
        if(indicies[i] < arrays[i].length - 1) {
          indicies[i]++;
          break
        }
        if(0 == i) {
          indicies = null;
          break
        }
        indicies[i] = 0
      }
      return retVal
    }
    throw goog.iter.StopIteration;
  };
  return iter
};
goog.iter.cycle = function $goog$iter$cycle$(iterable) {
  var baseIterator = goog.iter.toIterator(iterable), cache = [], cacheIndex = 0, iter = new goog.iter.Iterator, useCache = !1;
  iter.next = function $iter$next$() {
    var returnElement = null;
    if(!useCache) {
      try {
        return returnElement = baseIterator.next(), cache.push(returnElement), returnElement
      }catch(e) {
        if(e != goog.iter.StopIteration || goog.array.isEmpty(cache)) {
          throw e;
        }
        useCache = !0
      }
    }
    returnElement = cache[cacheIndex];
    cacheIndex = (cacheIndex + 1) % cache.length;
    return returnElement
  };
  return iter
};
goog.structs.getCount = function $goog$structs$getCount$(col) {
  return"function" == typeof col.getCount ? col.getCount() : goog.isArrayLike(col) || goog.isString(col) ? col.length : goog.object.getCount(col)
};
goog.structs.getValues = function $goog$structs$getValues$(col) {
  if("function" == typeof col.getValues) {
    return col.getValues()
  }
  if(goog.isString(col)) {
    return col.split("")
  }
  if(goog.isArrayLike(col)) {
    for(var rv = [], l = col.length, i = 0;i < l;i++) {
      rv.push(col[i])
    }
    return rv
  }
  return goog.object.getValues(col)
};
goog.structs.getKeys = function $goog$structs$getKeys$(col) {
  if("function" == typeof col.getKeys) {
    return col.getKeys()
  }
  if("function" != typeof col.getValues) {
    if(goog.isArrayLike(col) || goog.isString(col)) {
      for(var rv = [], l = col.length, i = 0;i < l;i++) {
        rv.push(i)
      }
      return rv
    }
    return goog.object.getKeys(col)
  }
};
goog.structs.contains = function $goog$structs$contains$(col, val) {
  return"function" == typeof col.contains ? col.contains(val) : "function" == typeof col.containsValue ? col.containsValue(val) : goog.isArrayLike(col) || goog.isString(col) ? goog.array.contains(col, val) : goog.object.containsValue(col, val)
};
goog.structs.isEmpty = function $goog$structs$isEmpty$(col) {
  return"function" == typeof col.isEmpty ? col.isEmpty() : goog.isArrayLike(col) || goog.isString(col) ? goog.array.isEmpty(col) : goog.object.isEmpty(col)
};
goog.structs.clear = function $goog$structs$clear$(col) {
  "function" == typeof col.clear ? col.clear() : goog.isArrayLike(col) ? goog.array.clear(col) : goog.object.clear(col)
};
goog.structs.forEach = function $goog$structs$forEach$(col, f, opt_obj) {
  if("function" == typeof col.forEach) {
    col.forEach(f, opt_obj)
  }else {
    if(goog.isArrayLike(col) || goog.isString(col)) {
      goog.array.forEach(col, f, opt_obj)
    }else {
      for(var keys = goog.structs.getKeys(col), values = goog.structs.getValues(col), l = values.length, i = 0;i < l;i++) {
        f.call(opt_obj, values[i], keys && keys[i], col)
      }
    }
  }
};
goog.structs.filter = function $goog$structs$filter$(col, f, opt_obj) {
  if("function" == typeof col.filter) {
    return col.filter(f, opt_obj)
  }
  if(goog.isArrayLike(col) || goog.isString(col)) {
    return goog.array.filter(col, f, opt_obj)
  }
  var rv, keys = goog.structs.getKeys(col), values = goog.structs.getValues(col), l = values.length;
  if(keys) {
    rv = {};
    for(var i = 0;i < l;i++) {
      f.call(opt_obj, values[i], keys[i], col) && (rv[keys[i]] = values[i])
    }
  }else {
    rv = [];
    for(i = 0;i < l;i++) {
      f.call(opt_obj, values[i], void 0, col) && rv.push(values[i])
    }
  }
  return rv
};
goog.structs.map = function $goog$structs$map$(col, f, opt_obj) {
  if("function" == typeof col.map) {
    return col.map(f, opt_obj)
  }
  if(goog.isArrayLike(col) || goog.isString(col)) {
    return goog.array.map(col, f, opt_obj)
  }
  var rv, keys = goog.structs.getKeys(col), values = goog.structs.getValues(col), l = values.length;
  if(keys) {
    rv = {};
    for(var i = 0;i < l;i++) {
      rv[keys[i]] = f.call(opt_obj, values[i], keys[i], col)
    }
  }else {
    rv = [];
    for(i = 0;i < l;i++) {
      rv[i] = f.call(opt_obj, values[i], void 0, col)
    }
  }
  return rv
};
goog.structs.some = function $goog$structs$some$(col, f, opt_obj) {
  if("function" == typeof col.some) {
    return col.some(f, opt_obj)
  }
  if(goog.isArrayLike(col) || goog.isString(col)) {
    return goog.array.some(col, f, opt_obj)
  }
  for(var keys = goog.structs.getKeys(col), values = goog.structs.getValues(col), l = values.length, i = 0;i < l;i++) {
    if(f.call(opt_obj, values[i], keys && keys[i], col)) {
      return!0
    }
  }
  return!1
};
goog.structs.every = function $goog$structs$every$(col, f, opt_obj) {
  if("function" == typeof col.every) {
    return col.every(f, opt_obj)
  }
  if(goog.isArrayLike(col) || goog.isString(col)) {
    return goog.array.every(col, f, opt_obj)
  }
  for(var keys = goog.structs.getKeys(col), values = goog.structs.getValues(col), l = values.length, i = 0;i < l;i++) {
    if(!f.call(opt_obj, values[i], keys && keys[i], col)) {
      return!1
    }
  }
  return!0
};
goog.structs.Map = function $goog$structs$Map$(opt_map, var_args) {
  this.map_ = {};
  this.keys_ = [];
  var argLength = arguments.length;
  if(1 < argLength) {
    if(argLength % 2) {
      throw Error("Uneven number of arguments");
    }
    for(var i = 0;i < argLength;i += 2) {
      this.set(arguments[i], arguments[i + 1])
    }
  }else {
    opt_map && this.addAll(opt_map)
  }
};
goog.structs.Map.prototype.count_ = 0;
goog.structs.Map.prototype.version_ = 0;
goog.structs.Map.prototype.getCount = function $goog$structs$Map$$getCount$() {
  return this.count_
};
goog.structs.Map.prototype.getValues = function $goog$structs$Map$$getValues$() {
  this.cleanupKeysArray_();
  for(var rv = [], i = 0;i < this.keys_.length;i++) {
    var key = this.keys_[i];
    rv.push(this.map_[key])
  }
  return rv
};
goog.structs.Map.prototype.getKeys = function $goog$structs$Map$$getKeys$() {
  this.cleanupKeysArray_();
  return this.keys_.concat()
};
goog.structs.Map.prototype.containsKey = function $goog$structs$Map$$containsKey$(key) {
  return goog.structs.Map.hasKey_(this.map_, key)
};
goog.structs.Map.prototype.containsValue = function $goog$structs$Map$$containsValue$(val) {
  for(var i = 0;i < this.keys_.length;i++) {
    var key = this.keys_[i];
    if(goog.structs.Map.hasKey_(this.map_, key) && this.map_[key] == val) {
      return!0
    }
  }
  return!1
};
goog.structs.Map.prototype.equals = function $goog$structs$Map$$equals$(otherMap, opt_equalityFn) {
  if(this === otherMap) {
    return!0
  }
  if(this.count_ != otherMap.getCount()) {
    return!1
  }
  var equalityFn = opt_equalityFn || goog.structs.Map.defaultEquals;
  this.cleanupKeysArray_();
  for(var key, i = 0;key = this.keys_[i];i++) {
    if(!equalityFn(this.get(key), otherMap.get(key))) {
      return!1
    }
  }
  return!0
};
goog.structs.Map.defaultEquals = function $goog$structs$Map$defaultEquals$(a, b) {
  return a === b
};
goog.structs.Map.prototype.isEmpty = function $goog$structs$Map$$isEmpty$() {
  return 0 == this.count_
};
goog.structs.Map.prototype.clear = function $goog$structs$Map$$clear$() {
  this.map_ = {};
  this.version_ = this.count_ = this.keys_.length = 0
};
goog.structs.Map.prototype.remove = function $goog$structs$Map$$remove$(key) {
  return goog.structs.Map.hasKey_(this.map_, key) ? (delete this.map_[key], this.count_--, this.version_++, this.keys_.length > 2 * this.count_ && this.cleanupKeysArray_(), !0) : !1
};
goog.structs.Map.prototype.cleanupKeysArray_ = function $goog$structs$Map$$cleanupKeysArray_$() {
  if(this.count_ != this.keys_.length) {
    for(var srcIndex = 0, destIndex = 0;srcIndex < this.keys_.length;) {
      var key = this.keys_[srcIndex];
      goog.structs.Map.hasKey_(this.map_, key) && (this.keys_[destIndex++] = key);
      srcIndex++
    }
    this.keys_.length = destIndex
  }
  if(this.count_ != this.keys_.length) {
    for(var seen = {}, destIndex = srcIndex = 0;srcIndex < this.keys_.length;) {
      key = this.keys_[srcIndex], goog.structs.Map.hasKey_(seen, key) || (this.keys_[destIndex++] = key, seen[key] = 1), srcIndex++
    }
    this.keys_.length = destIndex
  }
};
goog.structs.Map.prototype.get = function $goog$structs$Map$$get$(key, opt_val) {
  return goog.structs.Map.hasKey_(this.map_, key) ? this.map_[key] : opt_val
};
goog.structs.Map.prototype.set = function $goog$structs$Map$$set$(key, value) {
  goog.structs.Map.hasKey_(this.map_, key) || (this.count_++, this.keys_.push(key), this.version_++);
  this.map_[key] = value
};
goog.structs.Map.prototype.addAll = function $goog$structs$Map$$addAll$(map) {
  var keys, values;
  map instanceof goog.structs.Map ? (keys = map.getKeys(), values = map.getValues()) : (keys = goog.object.getKeys(map), values = goog.object.getValues(map));
  for(var i = 0;i < keys.length;i++) {
    this.set(keys[i], values[i])
  }
};
goog.structs.Map.prototype.clone = function $goog$structs$Map$$clone$() {
  return new goog.structs.Map(this)
};
goog.structs.Map.prototype.transpose = function $goog$structs$Map$$transpose$() {
  for(var transposed = new goog.structs.Map, i = 0;i < this.keys_.length;i++) {
    var key = this.keys_[i], value = this.map_[key];
    transposed.set(value, key)
  }
  return transposed
};
goog.structs.Map.prototype.__iterator__ = function $goog$structs$Map$$__iterator__$(opt_keys) {
  this.cleanupKeysArray_();
  var i = 0, keys = this.keys_, map = this.map_, version = this.version_, selfObj = this, newIter = new goog.iter.Iterator;
  newIter.next = function $newIter$next$() {
    for(;;) {
      if(version != selfObj.version_) {
        throw Error("The map has changed since the iterator was created");
      }
      if(i >= keys.length) {
        throw goog.iter.StopIteration;
      }
      var key = keys[i++];
      return opt_keys ? key : map[key]
    }
  };
  return newIter
};
goog.structs.Map.hasKey_ = function $goog$structs$Map$hasKey_$(obj, key) {
  return Object.prototype.hasOwnProperty.call(obj, key)
};
goog.structs.Set = function $goog$structs$Set$(opt_values) {
  this.map_ = new goog.structs.Map;
  opt_values && this.addAll(opt_values)
};
goog.structs.Set.getKey_ = function $goog$structs$Set$getKey_$(val) {
  var type = typeof val;
  return"object" == type && val || "function" == type ? "o" + goog.getUid(val) : type.substr(0, 1) + val
};
goog.structs.Set.prototype.getCount = function $goog$structs$Set$$getCount$() {
  return this.map_.getCount()
};
goog.structs.Set.prototype.add = function $goog$structs$Set$$add$(element) {
  this.map_.set(goog.structs.Set.getKey_(element), element)
};
goog.structs.Set.prototype.addAll = function $goog$structs$Set$$addAll$(col) {
  for(var values = goog.structs.getValues(col), l = values.length, i = 0;i < l;i++) {
    this.add(values[i])
  }
};
goog.structs.Set.prototype.removeAll = function $goog$structs$Set$$removeAll$(col) {
  for(var values = goog.structs.getValues(col), l = values.length, i = 0;i < l;i++) {
    this.remove(values[i])
  }
};
goog.structs.Set.prototype.remove = function $goog$structs$Set$$remove$(element) {
  return this.map_.remove(goog.structs.Set.getKey_(element))
};
goog.structs.Set.prototype.clear = function $goog$structs$Set$$clear$() {
  this.map_.clear()
};
goog.structs.Set.prototype.isEmpty = function $goog$structs$Set$$isEmpty$() {
  return this.map_.isEmpty()
};
goog.structs.Set.prototype.contains = function $goog$structs$Set$$contains$(element) {
  return this.map_.containsKey(goog.structs.Set.getKey_(element))
};
goog.structs.Set.prototype.intersection = function $goog$structs$Set$$intersection$(col) {
  for(var result = new goog.structs.Set, values = goog.structs.getValues(col), i = 0;i < values.length;i++) {
    var value = values[i];
    this.contains(value) && result.add(value)
  }
  return result
};
goog.structs.Set.prototype.difference = function $goog$structs$Set$$difference$(col) {
  var result = this.clone();
  result.removeAll(col);
  return result
};
goog.structs.Set.prototype.getValues = function $goog$structs$Set$$getValues$() {
  return this.map_.getValues()
};
goog.structs.Set.prototype.clone = function $goog$structs$Set$$clone$() {
  return new goog.structs.Set(this)
};
goog.structs.Set.prototype.equals = function $goog$structs$Set$$equals$(col) {
  return this.getCount() == goog.structs.getCount(col) && this.isSubsetOf(col)
};
goog.structs.Set.prototype.isSubsetOf = function $goog$structs$Set$$isSubsetOf$(col) {
  var colCount = goog.structs.getCount(col);
  if(this.getCount() > colCount) {
    return!1
  }
  !(col instanceof goog.structs.Set) && 5 < colCount && (col = new goog.structs.Set(col));
  return goog.structs.every(this, function(value) {
    return goog.structs.contains(col, value)
  })
};
goog.structs.Set.prototype.__iterator__ = function $goog$structs$Set$$__iterator__$() {
  return this.map_.__iterator__(!1)
};
goog.debug.catchErrors = function $goog$debug$catchErrors$(logFunc, opt_cancel, opt_target) {
  var target = opt_target || goog.global, oldErrorHandler = target.onerror, retVal = !!opt_cancel;
  goog.userAgent.WEBKIT && !goog.userAgent.isVersion("535.3") && (retVal = !retVal);
  target.onerror = function $target$onerror$(message, url, line) {
    oldErrorHandler && oldErrorHandler(message, url, line);
    logFunc({message:message, fileName:url, line:line});
    return retVal
  }
};
goog.debug.expose = function $goog$debug$expose$(obj, opt_showFn) {
  if("undefined" == typeof obj) {
    return"undefined"
  }
  if(null == obj) {
    return"NULL"
  }
  var str = [], x;
  for(x in obj) {
    if(opt_showFn || !goog.isFunction(obj[x])) {
      var s = x + " = ";
      try {
        s += obj[x]
      }catch(e) {
        s += "*** " + e + " ***"
      }
      str.push(s)
    }
  }
  return str.join("\n")
};
goog.debug.deepExpose = function $goog$debug$deepExpose$(obj$$0, opt_showFn) {
  var previous = new goog.structs.Set, str = [], helper = function $helper$(obj, space) {
    var nestspace = space + "  ";
    try {
      if(goog.isDef(obj)) {
        if(goog.isNull(obj)) {
          str.push("NULL")
        }else {
          if(goog.isString(obj)) {
            str.push('"' + obj.replace(/\n/g, "\n" + space) + '"')
          }else {
            if(goog.isFunction(obj)) {
              str.push(("" + obj).replace(/\n/g, "\n" + space))
            }else {
              if(goog.isObject(obj)) {
                if(previous.contains(obj)) {
                  str.push("*** reference loop detected ***")
                }else {
                  previous.add(obj);
                  str.push("{");
                  for(var x in obj) {
                    if(opt_showFn || !goog.isFunction(obj[x])) {
                      str.push("\n"), str.push(nestspace), str.push(x + " = "), helper(obj[x], nestspace)
                    }
                  }
                  str.push("\n" + space + "}")
                }
              }else {
                str.push(obj)
              }
            }
          }
        }
      }else {
        str.push("undefined")
      }
    }catch(e) {
      str.push("*** " + e + " ***")
    }
  };
  helper(obj$$0, "");
  return str.join("")
};
goog.debug.exposeArray = function $goog$debug$exposeArray$(arr) {
  for(var str = [], i = 0;i < arr.length;i++) {
    goog.isArray(arr[i]) ? str.push(goog.debug.exposeArray(arr[i])) : str.push(arr[i])
  }
  return"[ " + str.join(", ") + " ]"
};
goog.debug.exposeException = function $goog$debug$exposeException$(err, opt_fn) {
  try {
    var e = goog.debug.normalizeErrorObject(err), error = "Message: " + goog.string.htmlEscape(e.message) + '\nUrl: <a href="view-source:' + e.fileName + '" target="_new">' + e.fileName + "</a>\nLine: " + e.lineNumber + "\n\nBrowser stack:\n" + goog.string.htmlEscape(e.stack + "-> ") + "[end]\n\nJS stack traversal:\n" + goog.string.htmlEscape(goog.debug.getStacktrace(opt_fn) + "-> ");
    return error
  }catch(e2) {
    return"Exception trying to expose exception! You win, we lose. " + e2
  }
};
goog.debug.normalizeErrorObject = function $goog$debug$normalizeErrorObject$(err) {
  var href = goog.getObjectByName("window.location.href");
  if(goog.isString(err)) {
    return{message:err, name:"Unknown error", lineNumber:"Not available", fileName:href, stack:"Not available"}
  }
  var lineNumber, fileName, threwError = !1;
  try {
    lineNumber = err.lineNumber || err.line || "Not available"
  }catch(e) {
    lineNumber = "Not available", threwError = !0
  }
  try {
    fileName = err.fileName || err.filename || err.sourceURL || href
  }catch(e$$0) {
    fileName = "Not available", threwError = !0
  }
  return threwError || !err.lineNumber || !err.fileName || !err.stack ? {message:err.message, name:err.name, lineNumber:lineNumber, fileName:fileName, stack:err.stack || "Not available"} : err
};
goog.debug.enhanceError = function $goog$debug$enhanceError$(err, opt_message) {
  var error = "string" == typeof err ? Error(err) : err;
  error.stack || (error.stack = goog.debug.getStacktrace(arguments.callee.caller));
  if(opt_message) {
    for(var x = 0;error["message" + x];) {
      ++x
    }
    error["message" + x] = "" + opt_message
  }
  return error
};
goog.debug.getStacktraceSimple = function $goog$debug$getStacktraceSimple$(opt_depth) {
  for(var sb = [], fn = arguments.callee.caller, depth = 0;fn && (!opt_depth || depth < opt_depth);) {
    sb.push(goog.debug.getFunctionName(fn));
    sb.push("()\n");
    try {
      fn = fn.caller
    }catch(e) {
      sb.push("[exception trying to get caller]\n");
      break
    }
    depth++;
    if(depth >= goog.debug.MAX_STACK_DEPTH) {
      sb.push("[...long stack...]");
      break
    }
  }
  opt_depth && depth >= opt_depth ? sb.push("[...reached max depth limit...]") : sb.push("[end]");
  return sb.join("")
};
goog.debug.MAX_STACK_DEPTH = 50;
goog.debug.getStacktrace = function $goog$debug$getStacktrace$(opt_fn) {
  return goog.debug.getStacktraceHelper_(opt_fn || arguments.callee.caller, [])
};
goog.debug.getStacktraceHelper_ = function $goog$debug$getStacktraceHelper_$(fn, visited) {
  var sb = [];
  if(goog.array.contains(visited, fn)) {
    sb.push("[...circular reference...]")
  }else {
    if(fn && visited.length < goog.debug.MAX_STACK_DEPTH) {
      sb.push(goog.debug.getFunctionName(fn) + "(");
      for(var args = fn.arguments, i = 0;i < args.length;i++) {
        0 < i && sb.push(", ");
        var argDesc, arg = args[i];
        switch(typeof arg) {
          case "object":
            argDesc = arg ? "object" : "null";
            break;
          case "string":
            argDesc = arg;
            break;
          case "number":
            argDesc = "" + arg;
            break;
          case "boolean":
            argDesc = arg ? "true" : "false";
            break;
          case "function":
            argDesc = (argDesc = goog.debug.getFunctionName(arg)) ? argDesc : "[fn]";
            break;
          default:
            argDesc = typeof arg
        }
        40 < argDesc.length && (argDesc = argDesc.substr(0, 40) + "...");
        sb.push(argDesc)
      }
      visited.push(fn);
      sb.push(")\n");
      try {
        sb.push(goog.debug.getStacktraceHelper_(fn.caller, visited))
      }catch(e) {
        sb.push("[exception trying to get caller]\n")
      }
    }else {
      fn ? sb.push("[...long stack...]") : sb.push("[end]")
    }
  }
  return sb.join("")
};
goog.debug.setFunctionResolver = function $goog$debug$setFunctionResolver$(resolver) {
  goog.debug.fnNameResolver_ = resolver
};
goog.debug.getFunctionName = function $goog$debug$getFunctionName$(fn) {
  if(goog.debug.fnNameCache_[fn]) {
    return goog.debug.fnNameCache_[fn]
  }
  if(goog.debug.fnNameResolver_) {
    var name = goog.debug.fnNameResolver_(fn);
    if(name) {
      return goog.debug.fnNameCache_[fn] = name
    }
  }
  var functionSource = "" + fn;
  if(!goog.debug.fnNameCache_[functionSource]) {
    var matches = /function ([^\(]+)/.exec(functionSource);
    if(matches) {
      var method = matches[1];
      goog.debug.fnNameCache_[functionSource] = method
    }else {
      goog.debug.fnNameCache_[functionSource] = "[Anonymous]"
    }
  }
  return goog.debug.fnNameCache_[functionSource]
};
goog.debug.makeWhitespaceVisible = function $goog$debug$makeWhitespaceVisible$(string) {
  return string.replace(/ /g, "[_]").replace(/\f/g, "[f]").replace(/\n/g, "[n]\n").replace(/\r/g, "[r]").replace(/\t/g, "[t]")
};
goog.debug.fnNameCache_ = {};
goog.debug.LogRecord = function $goog$debug$LogRecord$(level, msg, loggerName, opt_time, opt_sequenceNumber) {
  this.reset(level, msg, loggerName, opt_time, opt_sequenceNumber)
};
goog.debug.LogRecord.prototype.exception_ = null;
goog.debug.LogRecord.prototype.exceptionText_ = null;
goog.debug.LogRecord.ENABLE_SEQUENCE_NUMBERS = !0;
goog.debug.LogRecord.nextSequenceNumber_ = 0;
goog.debug.LogRecord.prototype.reset = function $goog$debug$LogRecord$$reset$(level, msg, loggerName, opt_time, opt_sequenceNumber) {
  goog.debug.LogRecord.ENABLE_SEQUENCE_NUMBERS && ("number" == typeof opt_sequenceNumber || goog.debug.LogRecord.nextSequenceNumber_++);
  opt_time || goog.now();
  this.level_ = level;
  this.msg_ = msg;
  delete this.exception_;
  delete this.exceptionText_
};
goog.debug.LogRecord.prototype.setException = function $goog$debug$LogRecord$$setException$(exception) {
  this.exception_ = exception
};
goog.debug.LogRecord.prototype.setExceptionText = function $goog$debug$LogRecord$$setExceptionText$(text) {
  this.exceptionText_ = text
};
goog.debug.LogRecord.prototype.setLevel = function $goog$debug$LogRecord$$setLevel$(level) {
  this.level_ = level
};
goog.debug.LogRecord.prototype.getMessage = function $goog$debug$LogRecord$$getMessage$() {
  return this.msg_
};
goog.debug.LogBuffer = function $goog$debug$LogBuffer$() {
  goog.asserts.assert(goog.debug.LogBuffer.isBufferingEnabled(), "Cannot use goog.debug.LogBuffer without defining goog.debug.LogBuffer.CAPACITY.");
  this.clear()
};
goog.debug.LogBuffer.getInstance = function $goog$debug$LogBuffer$getInstance$() {
  goog.debug.LogBuffer.instance_ || (goog.debug.LogBuffer.instance_ = new goog.debug.LogBuffer);
  return goog.debug.LogBuffer.instance_
};
goog.debug.LogBuffer.CAPACITY = 0;
goog.debug.LogBuffer.prototype.addRecord = function $goog$debug$LogBuffer$$addRecord$(level, msg, loggerName) {
  var curIndex = (this.curIndex_ + 1) % goog.debug.LogBuffer.CAPACITY;
  this.curIndex_ = curIndex;
  if(this.isFull_) {
    var ret = this.buffer_[curIndex];
    ret.reset(level, msg, loggerName);
    return ret
  }
  this.isFull_ = curIndex == goog.debug.LogBuffer.CAPACITY - 1;
  return this.buffer_[curIndex] = new goog.debug.LogRecord(level, msg, loggerName)
};
goog.debug.LogBuffer.isBufferingEnabled = function $goog$debug$LogBuffer$isBufferingEnabled$() {
  return 0 < goog.debug.LogBuffer.CAPACITY
};
goog.debug.LogBuffer.prototype.clear = function $goog$debug$LogBuffer$$clear$() {
  this.buffer_ = Array(goog.debug.LogBuffer.CAPACITY);
  this.curIndex_ = -1;
  this.isFull_ = !1
};
goog.debug.Logger = function $goog$debug$Logger$(name) {
  this.name_ = name
};
goog.debug.Logger.prototype.parent_ = null;
goog.debug.Logger.prototype.level_ = null;
goog.debug.Logger.prototype.children_ = null;
goog.debug.Logger.prototype.handlers_ = null;
goog.debug.Logger.ENABLE_HIERARCHY = !0;
goog.debug.Logger.ENABLE_HIERARCHY || (goog.debug.Logger.rootHandlers_ = []);
goog.debug.Logger.Level = function $goog$debug$Logger$Level$(name, value) {
  this.name = name;
  this.value = value
};
goog.debug.Logger.Level.prototype.toString = function $goog$debug$Logger$Level$$toString$() {
  return this.name
};
goog.debug.Logger.Level.OFF = new goog.debug.Logger.Level("OFF", Infinity);
goog.debug.Logger.Level.SHOUT = new goog.debug.Logger.Level("SHOUT", 1200);
goog.debug.Logger.Level.SEVERE = new goog.debug.Logger.Level("SEVERE", 1E3);
goog.debug.Logger.Level.WARNING = new goog.debug.Logger.Level("WARNING", 900);
goog.debug.Logger.Level.INFO = new goog.debug.Logger.Level("INFO", 800);
goog.debug.Logger.Level.CONFIG = new goog.debug.Logger.Level("CONFIG", 700);
goog.debug.Logger.Level.FINE = new goog.debug.Logger.Level("FINE", 500);
goog.debug.Logger.Level.FINER = new goog.debug.Logger.Level("FINER", 400);
goog.debug.Logger.Level.FINEST = new goog.debug.Logger.Level("FINEST", 300);
goog.debug.Logger.Level.ALL = new goog.debug.Logger.Level("ALL", 0);
goog.debug.Logger.Level.PREDEFINED_LEVELS = [goog.debug.Logger.Level.OFF, goog.debug.Logger.Level.SHOUT, goog.debug.Logger.Level.SEVERE, goog.debug.Logger.Level.WARNING, goog.debug.Logger.Level.INFO, goog.debug.Logger.Level.CONFIG, goog.debug.Logger.Level.FINE, goog.debug.Logger.Level.FINER, goog.debug.Logger.Level.FINEST, goog.debug.Logger.Level.ALL];
goog.debug.Logger.Level.predefinedLevelsCache_ = null;
goog.debug.Logger.Level.createPredefinedLevelsCache_ = function $goog$debug$Logger$Level$createPredefinedLevelsCache_$() {
  goog.debug.Logger.Level.predefinedLevelsCache_ = {};
  for(var i = 0, level;level = goog.debug.Logger.Level.PREDEFINED_LEVELS[i];i++) {
    goog.debug.Logger.Level.predefinedLevelsCache_[level.value] = level;
    goog.debug.Logger.Level.predefinedLevelsCache_[level.name] = level
  }
};
goog.debug.Logger.Level.getPredefinedLevel = function $goog$debug$Logger$Level$getPredefinedLevel$(name) {
  goog.debug.Logger.Level.predefinedLevelsCache_ || goog.debug.Logger.Level.createPredefinedLevelsCache_();
  return goog.debug.Logger.Level.predefinedLevelsCache_[name] || null
};
goog.debug.Logger.Level.getPredefinedLevelByValue = function $goog$debug$Logger$Level$getPredefinedLevelByValue$(value) {
  goog.debug.Logger.Level.predefinedLevelsCache_ || goog.debug.Logger.Level.createPredefinedLevelsCache_();
  if(value in goog.debug.Logger.Level.predefinedLevelsCache_) {
    return goog.debug.Logger.Level.predefinedLevelsCache_[value]
  }
  for(var i = 0;i < goog.debug.Logger.Level.PREDEFINED_LEVELS.length;++i) {
    var level = goog.debug.Logger.Level.PREDEFINED_LEVELS[i];
    if(level.value <= value) {
      return level
    }
  }
  return null
};
goog.debug.Logger.getLogger = function $goog$debug$Logger$getLogger$(name) {
  return goog.debug.LogManager.getLogger(name)
};
goog.debug.Logger.logToProfilers = function $goog$debug$Logger$logToProfilers$(msg) {
  if(goog.global.console) {
    if(goog.global.console.timeStamp) {
      goog.global.console.timeStamp(msg)
    }else {
      if(goog.global.console.markTimeline) {
        goog.global.console.markTimeline(msg)
      }
    }
  }
  if(goog.global.msWriteProfilerMark) {
    goog.global.msWriteProfilerMark(msg)
  }
};
goog.debug.Logger.prototype.getParent = function $goog$debug$Logger$$getParent$() {
  return this.parent_
};
goog.debug.Logger.prototype.getChildren = function $goog$debug$Logger$$getChildren$() {
  if(!this.children_) {
    this.children_ = {}
  }
  return this.children_
};
goog.debug.Logger.prototype.setLevel = function $goog$debug$Logger$$setLevel$(level) {
  if(goog.debug.Logger.ENABLE_HIERARCHY) {
    this.level_ = level
  }else {
    goog.asserts.assert(!this.name_, "Cannot call setLevel() on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false.");
    goog.debug.Logger.rootLevel_ = level
  }
};
goog.debug.Logger.prototype.getEffectiveLevel = function $goog$debug$Logger$$getEffectiveLevel$() {
  if(!goog.debug.Logger.ENABLE_HIERARCHY) {
    return goog.debug.Logger.rootLevel_
  }
  if(this.level_) {
    return this.level_
  }
  if(this.parent_) {
    return this.parent_.getEffectiveLevel()
  }
  goog.asserts.fail("Root logger has no level set.");
  return null
};
goog.debug.Logger.prototype.isLoggable = function $goog$debug$Logger$$isLoggable$(level) {
  return level.value >= this.getEffectiveLevel().value
};
goog.debug.Logger.prototype.log = function $goog$debug$Logger$$log$(level, msg, opt_exception) {
  this.isLoggable(level) && this.doLogRecord_(this.getLogRecord(level, msg, opt_exception))
};
goog.debug.Logger.prototype.getLogRecord = function $goog$debug$Logger$$getLogRecord$(level, msg, opt_exception) {
  var logRecord = goog.debug.LogBuffer.isBufferingEnabled() ? goog.debug.LogBuffer.getInstance().addRecord(level, msg, this.name_) : new goog.debug.LogRecord(level, "" + msg, this.name_);
  if(opt_exception) {
    logRecord.setException(opt_exception);
    logRecord.setExceptionText(goog.debug.exposeException(opt_exception, arguments.callee.caller))
  }
  return logRecord
};
goog.debug.Logger.prototype.shout = function $goog$debug$Logger$$shout$(msg, opt_exception) {
  this.log(goog.debug.Logger.Level.SHOUT, msg, opt_exception)
};
goog.debug.Logger.prototype.severe = function $goog$debug$Logger$$severe$(msg, opt_exception) {
  this.log(goog.debug.Logger.Level.SEVERE, msg, opt_exception)
};
goog.debug.Logger.prototype.warning = function $goog$debug$Logger$$warning$(msg, opt_exception) {
  this.log(goog.debug.Logger.Level.WARNING, msg, opt_exception)
};
goog.debug.Logger.prototype.info = function $goog$debug$Logger$$info$(msg, opt_exception) {
  this.log(goog.debug.Logger.Level.INFO, msg, opt_exception)
};
goog.debug.Logger.prototype.config = function $goog$debug$Logger$$config$(msg, opt_exception) {
  this.log(goog.debug.Logger.Level.CONFIG, msg, opt_exception)
};
goog.debug.Logger.prototype.fine = function $goog$debug$Logger$$fine$(msg, opt_exception) {
  this.log(goog.debug.Logger.Level.FINE, msg, opt_exception)
};
goog.debug.Logger.prototype.doLogRecord_ = function $goog$debug$Logger$$doLogRecord_$(logRecord) {
  goog.debug.Logger.logToProfilers("log:" + logRecord.getMessage());
  if(goog.debug.Logger.ENABLE_HIERARCHY) {
    for(var target = this;target;) {
      target.callPublish_(logRecord);
      target = target.getParent()
    }
  }else {
    for(var i = 0, handler;handler = goog.debug.Logger.rootHandlers_[i++];) {
      handler(logRecord)
    }
  }
};
goog.debug.Logger.prototype.callPublish_ = function $goog$debug$Logger$$callPublish_$(logRecord) {
  if(this.handlers_) {
    for(var i = 0, handler;handler = this.handlers_[i];i++) {
      handler(logRecord)
    }
  }
};
goog.debug.Logger.prototype.setParent_ = function $goog$debug$Logger$$setParent_$(parent) {
  this.parent_ = parent
};
goog.debug.Logger.prototype.addChild_ = function $goog$debug$Logger$$addChild_$(name, logger) {
  this.getChildren()[name] = logger
};
goog.debug.LogManager = {};
goog.debug.LogManager.loggers_ = {};
goog.debug.LogManager.rootLogger_ = null;
goog.debug.LogManager.initialize = function $goog$debug$LogManager$initialize$() {
  if(!goog.debug.LogManager.rootLogger_) {
    goog.debug.LogManager.rootLogger_ = new goog.debug.Logger("");
    goog.debug.LogManager.loggers_[""] = goog.debug.LogManager.rootLogger_;
    goog.debug.LogManager.rootLogger_.setLevel(goog.debug.Logger.Level.CONFIG)
  }
};
goog.debug.LogManager.getLoggers = function $goog$debug$LogManager$getLoggers$() {
  return goog.debug.LogManager.loggers_
};
goog.debug.LogManager.getRoot = function $goog$debug$LogManager$getRoot$() {
  goog.debug.LogManager.initialize();
  return goog.debug.LogManager.rootLogger_
};
goog.debug.LogManager.getLogger = function $goog$debug$LogManager$getLogger$(name) {
  goog.debug.LogManager.initialize();
  var ret = goog.debug.LogManager.loggers_[name];
  return ret || goog.debug.LogManager.createLogger_(name)
};
goog.debug.LogManager.createFunctionForCatchErrors = function $goog$debug$LogManager$createFunctionForCatchErrors$(opt_logger) {
  return function(info) {
    var logger = opt_logger || goog.debug.LogManager.getRoot();
    logger.severe("Error: " + info.message + " (" + info.fileName + " @ Line: " + info.line + ")")
  }
};
goog.debug.LogManager.createLogger_ = function $goog$debug$LogManager$createLogger_$(name) {
  var logger = new goog.debug.Logger(name);
  if(goog.debug.Logger.ENABLE_HIERARCHY) {
    var lastDotIndex = name.lastIndexOf("."), parentName = name.substr(0, lastDotIndex), leafName = name.substr(lastDotIndex + 1), parentLogger = goog.debug.LogManager.getLogger(parentName);
    parentLogger.addChild_(leafName, logger);
    logger.setParent_(parentLogger)
  }
  return goog.debug.LogManager.loggers_[name] = logger
};
goog.dom.SavedRange = function $goog$dom$SavedRange$() {
  goog.Disposable.call(this)
};
goog.inherits(goog.dom.SavedRange, goog.Disposable);
goog.dom.SavedRange.logger_ = goog.debug.Logger.getLogger("goog.dom.SavedRange");
goog.dom.SavedRange.prototype.restore = function $goog$dom$SavedRange$$restore$(opt_stayAlive) {
  this.isDisposed() && goog.dom.SavedRange.logger_.severe("Disposed SavedRange objects cannot be restored.");
  var range = this.restoreInternal();
  opt_stayAlive || this.dispose();
  return range
};
goog.dom.SavedCaretRange = function $goog$dom$SavedCaretRange$(range) {
  goog.dom.SavedRange.call(this);
  this.startCaretId_ = goog.string.createUniqueString();
  this.endCaretId_ = goog.string.createUniqueString();
  this.dom_ = goog.dom.getDomHelper(range.getDocument());
  range.surroundWithNodes(this.createCaret_(!0), this.createCaret_(!1))
};
goog.inherits(goog.dom.SavedCaretRange, goog.dom.SavedRange);
goog.dom.SavedCaretRange.prototype.getCaret = function $goog$dom$SavedCaretRange$$getCaret$(start) {
  return this.dom_.getElement(start ? this.startCaretId_ : this.endCaretId_)
};
goog.dom.SavedCaretRange.prototype.removeCarets = function $goog$dom$SavedCaretRange$$removeCarets$(opt_range) {
  goog.dom.removeNode(this.getCaret(!0));
  goog.dom.removeNode(this.getCaret(!1));
  return opt_range
};
goog.dom.SavedCaretRange.prototype.restoreInternal = function $goog$dom$SavedCaretRange$$restoreInternal$() {
  var range = null, startCaret = this.getCaret(!0), endCaret = this.getCaret(!1);
  if(startCaret && endCaret) {
    var startNode = startCaret.parentNode, startOffset = goog.array.indexOf(startNode.childNodes, startCaret), endNode = endCaret.parentNode, endOffset = goog.array.indexOf(endNode.childNodes, endCaret);
    endNode == startNode && (endOffset -= 1);
    range = goog.dom.Range.createFromNodes(startNode, startOffset, endNode, endOffset);
    range = this.removeCarets(range);
    range.select()
  }else {
    this.removeCarets()
  }
  return range
};
goog.dom.SavedCaretRange.prototype.disposeInternal = function $goog$dom$SavedCaretRange$$disposeInternal$() {
  this.removeCarets();
  this.dom_ = null
};
goog.dom.SavedCaretRange.prototype.createCaret_ = function $goog$dom$SavedCaretRange$$createCaret_$(start) {
  return this.dom_.createDom(goog.dom.TagName.SPAN, {id:start ? this.startCaretId_ : this.endCaretId_})
};
goog.dom.SavedCaretRange.CARET_REGEX = /<span\s+id="?goog_\d+"?><\/span>/ig;
goog.dom.SavedCaretRange.htmlEqual = function $goog$dom$SavedCaretRange$htmlEqual$(str1, str2) {
  return str1 == str2 || str1.replace(goog.dom.SavedCaretRange.CARET_REGEX, "") == str2.replace(goog.dom.SavedCaretRange.CARET_REGEX, "")
};
goog.dom.TagWalkType = {START_TAG:1, OTHER:0, END_TAG:-1};
goog.dom.TagIterator = function $goog$dom$TagIterator$(opt_node, opt_reversed, opt_unconstrained, opt_tagType, opt_depth) {
  this.reversed = !!opt_reversed;
  opt_node && this.setPosition(opt_node, opt_tagType);
  this.depth = void 0 != opt_depth ? opt_depth : this.tagType || 0;
  this.reversed && (this.depth *= -1);
  this.constrained = !opt_unconstrained
};
goog.inherits(goog.dom.TagIterator, goog.iter.Iterator);
goog.dom.TagIterator.prototype.node = null;
goog.dom.TagIterator.prototype.tagType = goog.dom.TagWalkType.OTHER;
goog.dom.TagIterator.prototype.started_ = !1;
goog.dom.TagIterator.prototype.setPosition = function $goog$dom$TagIterator$$setPosition$(node, opt_tagType, opt_depth) {
  if(this.node = node) {
    this.tagType = goog.isNumber(opt_tagType) ? opt_tagType : this.node.nodeType != goog.dom.NodeType.ELEMENT ? goog.dom.TagWalkType.OTHER : this.reversed ? goog.dom.TagWalkType.END_TAG : goog.dom.TagWalkType.START_TAG
  }
  goog.isNumber(opt_depth) && (this.depth = opt_depth)
};
goog.dom.TagIterator.prototype.copyFrom = function $goog$dom$TagIterator$$copyFrom$(other) {
  this.node = other.node;
  this.tagType = other.tagType;
  this.depth = other.depth;
  this.reversed = other.reversed;
  this.constrained = other.constrained
};
goog.dom.TagIterator.prototype.clone = function $goog$dom$TagIterator$$clone$() {
  return new goog.dom.TagIterator(this.node, this.reversed, !this.constrained, this.tagType, this.depth)
};
goog.dom.TagIterator.prototype.restartTag = function $goog$dom$TagIterator$$restartTag$() {
  var check = this.reversed ? goog.dom.TagWalkType.START_TAG : goog.dom.TagWalkType.END_TAG;
  this.tagType == check && (this.tagType = -1 * check, this.depth += this.tagType * (this.reversed ? -1 : 1))
};
goog.dom.TagIterator.prototype.next = function $goog$dom$TagIterator$$next$() {
  var node;
  if(this.started_) {
    if(!this.node || this.constrained && 0 == this.depth) {
      throw goog.iter.StopIteration;
    }
    node = this.node;
    var startType = this.reversed ? goog.dom.TagWalkType.END_TAG : goog.dom.TagWalkType.START_TAG;
    if(this.tagType == startType) {
      var child = this.reversed ? node.lastChild : node.firstChild;
      child ? this.setPosition(child) : this.setPosition(node, -1 * startType)
    }else {
      var sibling = this.reversed ? node.previousSibling : node.nextSibling;
      sibling ? this.setPosition(sibling) : this.setPosition(node.parentNode, -1 * startType)
    }
    this.depth += this.tagType * (this.reversed ? -1 : 1)
  }else {
    this.started_ = !0
  }
  node = this.node;
  if(!this.node) {
    throw goog.iter.StopIteration;
  }
  return node
};
goog.dom.TagIterator.prototype.isStarted = function $goog$dom$TagIterator$$isStarted$() {
  return this.started_
};
goog.dom.TagIterator.prototype.isStartTag = function $goog$dom$TagIterator$$isStartTag$() {
  return this.tagType == goog.dom.TagWalkType.START_TAG
};
goog.dom.TagIterator.prototype.isEndTag = function $goog$dom$TagIterator$$isEndTag$() {
  return this.tagType == goog.dom.TagWalkType.END_TAG
};
goog.dom.TagIterator.prototype.equals = function $goog$dom$TagIterator$$equals$(other) {
  return other.node == this.node && (!this.node || other.tagType == this.tagType)
};
goog.dom.TagIterator.prototype.splice = function $goog$dom$TagIterator$$splice$(var_args) {
  var node = this.node;
  this.restartTag();
  this.reversed = !this.reversed;
  goog.dom.TagIterator.prototype.next.call(this);
  this.reversed = !this.reversed;
  for(var arr = goog.isArrayLike(arguments[0]) ? arguments[0] : arguments, i = arr.length - 1;0 <= i;i--) {
    goog.dom.insertSiblingAfter(arr[i], node)
  }
  goog.dom.removeNode(node)
};
goog.dom.RangeType = {TEXT:"text", CONTROL:"control", MULTI:"mutli"};
goog.dom.AbstractRange = function $goog$dom$AbstractRange$() {
};
goog.dom.AbstractRange.getBrowserSelectionForWindow = function $goog$dom$AbstractRange$getBrowserSelectionForWindow$(win) {
  if(win.getSelection) {
    return win.getSelection()
  }
  var doc = win.document, sel = doc.selection;
  if(sel) {
    try {
      var range = sel.createRange();
      if(range.parentElement) {
        if(range.parentElement().document != doc) {
          return null
        }
      }else {
        if(!range.length || range.item(0).document != doc) {
          return null
        }
      }
    }catch(e) {
      return null
    }
    return sel
  }
  return null
};
goog.dom.AbstractRange.isNativeControlRange = function $goog$dom$AbstractRange$isNativeControlRange$(range) {
  return!!range && !!range.addElement
};
goog.dom.AbstractRange.prototype.getTextRanges = function $goog$dom$AbstractRange$$getTextRanges$() {
  for(var output = [], i = 0, len = this.getTextRangeCount();i < len;i++) {
    output.push(this.getTextRange(i))
  }
  return output
};
goog.dom.AbstractRange.prototype.getContainerElement = function $goog$dom$AbstractRange$$getContainerElement$() {
  var node = this.getContainer();
  return node.nodeType == goog.dom.NodeType.ELEMENT ? node : node.parentNode
};
goog.dom.AbstractRange.prototype.getAnchorNode = function $goog$dom$AbstractRange$$getAnchorNode$() {
  return this.isReversed() ? this.getEndNode() : this.getStartNode()
};
goog.dom.AbstractRange.prototype.getAnchorOffset = function $goog$dom$AbstractRange$$getAnchorOffset$() {
  return this.isReversed() ? this.getEndOffset() : this.getStartOffset()
};
goog.dom.AbstractRange.prototype.getFocusNode = function $goog$dom$AbstractRange$$getFocusNode$() {
  return this.isReversed() ? this.getStartNode() : this.getEndNode()
};
goog.dom.AbstractRange.prototype.getFocusOffset = function $goog$dom$AbstractRange$$getFocusOffset$() {
  return this.isReversed() ? this.getStartOffset() : this.getEndOffset()
};
goog.dom.AbstractRange.prototype.isReversed = function $goog$dom$AbstractRange$$isReversed$() {
  return!1
};
goog.dom.AbstractRange.prototype.getDocument = function $goog$dom$AbstractRange$$getDocument$() {
  return goog.dom.getOwnerDocument(goog.userAgent.IE ? this.getContainer() : this.getStartNode())
};
goog.dom.AbstractRange.prototype.getWindow = function $goog$dom$AbstractRange$$getWindow$() {
  return goog.dom.getWindow(this.getDocument())
};
goog.dom.AbstractRange.prototype.containsNode = function $goog$dom$AbstractRange$$containsNode$(node, opt_allowPartial) {
  return this.containsRange(goog.dom.Range.createFromNodeContents(node), opt_allowPartial)
};
goog.dom.AbstractRange.prototype.replaceContentsWithNode = function $goog$dom$AbstractRange$$replaceContentsWithNode$(node) {
  this.isCollapsed() || this.removeContents();
  return this.insertNode(node, !0)
};
goog.dom.RangeIterator = function $goog$dom$RangeIterator$(node, opt_reverse) {
  goog.dom.TagIterator.call(this, node, opt_reverse, !0)
};
goog.inherits(goog.dom.RangeIterator, goog.dom.TagIterator);
goog.dom.AbstractMultiRange = function $goog$dom$AbstractMultiRange$() {
};
goog.inherits(goog.dom.AbstractMultiRange, goog.dom.AbstractRange);
goog.dom.AbstractMultiRange.prototype.containsRange = function $goog$dom$AbstractMultiRange$$containsRange$(otherRange, opt_allowPartial) {
  var ranges = this.getTextRanges(), otherRanges = otherRange.getTextRanges(), fn = opt_allowPartial ? goog.array.some : goog.array.every;
  return fn(otherRanges, function(otherRange) {
    return goog.array.some(ranges, function(range) {
      return range.containsRange(otherRange, opt_allowPartial)
    })
  })
};
goog.dom.AbstractMultiRange.prototype.insertNode = function $goog$dom$AbstractMultiRange$$insertNode$(node, before) {
  before ? goog.dom.insertSiblingBefore(node, this.getStartNode()) : goog.dom.insertSiblingAfter(node, this.getEndNode());
  return node
};
goog.dom.AbstractMultiRange.prototype.surroundWithNodes = function $goog$dom$AbstractMultiRange$$surroundWithNodes$(startNode, endNode) {
  this.insertNode(startNode, !0);
  this.insertNode(endNode, !1)
};
goog.dom.RangeEndpoint = {START:1, END:0};
goog.dom.TextRangeIterator = function $goog$dom$TextRangeIterator$(startNode, startOffset, endNode, endOffset, opt_reverse) {
  var goNext;
  if(startNode) {
    this.startNode_ = startNode;
    this.startOffset_ = startOffset;
    this.endNode_ = endNode;
    this.endOffset_ = endOffset;
    if(startNode.nodeType == goog.dom.NodeType.ELEMENT && startNode.tagName != goog.dom.TagName.BR) {
      var startChildren = startNode.childNodes, candidate = startChildren[startOffset];
      candidate ? (this.startNode_ = candidate, this.startOffset_ = 0) : (startChildren.length && (this.startNode_ = goog.array.peek(startChildren)), goNext = !0)
    }
    endNode.nodeType == goog.dom.NodeType.ELEMENT && ((this.endNode_ = endNode.childNodes[endOffset]) ? this.endOffset_ = 0 : this.endNode_ = endNode)
  }
  goog.dom.RangeIterator.call(this, opt_reverse ? this.endNode_ : this.startNode_, opt_reverse);
  if(goNext) {
    try {
      this.next()
    }catch(e) {
      if(e != goog.iter.StopIteration) {
        throw e;
      }
    }
  }
};
goog.inherits(goog.dom.TextRangeIterator, goog.dom.RangeIterator);
goog.dom.TextRangeIterator.prototype.startNode_ = null;
goog.dom.TextRangeIterator.prototype.endNode_ = null;
goog.dom.TextRangeIterator.prototype.startOffset_ = 0;
goog.dom.TextRangeIterator.prototype.endOffset_ = 0;
goog.dom.TextRangeIterator.prototype.getStartNode = function $goog$dom$TextRangeIterator$$getStartNode$() {
  return this.startNode_
};
goog.dom.TextRangeIterator.prototype.getEndNode = function $goog$dom$TextRangeIterator$$getEndNode$() {
  return this.endNode_
};
goog.dom.TextRangeIterator.prototype.isLast = function $goog$dom$TextRangeIterator$$isLast$() {
  return this.isStarted() && this.node == this.endNode_ && (!this.endOffset_ || !this.isStartTag())
};
goog.dom.TextRangeIterator.prototype.next = function $goog$dom$TextRangeIterator$$next$() {
  if(this.isLast()) {
    throw goog.iter.StopIteration;
  }
  return goog.dom.TextRangeIterator.superClass_.next.call(this)
};
goog.dom.TextRangeIterator.prototype.copyFrom = function $goog$dom$TextRangeIterator$$copyFrom$(other) {
  this.startNode_ = other.startNode_;
  this.endNode_ = other.endNode_;
  this.startOffset_ = other.startOffset_;
  this.endOffset_ = other.endOffset_;
  this.isReversed_ = other.isReversed_;
  goog.dom.TextRangeIterator.superClass_.copyFrom.call(this, other)
};
goog.dom.TextRangeIterator.prototype.clone = function $goog$dom$TextRangeIterator$$clone$() {
  var copy = new goog.dom.TextRangeIterator(this.startNode_, this.startOffset_, this.endNode_, this.endOffset_, this.isReversed_);
  copy.copyFrom(this);
  return copy
};
goog.dom.browserrange = {};
goog.dom.browserrange.AbstractRange = function $goog$dom$browserrange$AbstractRange$() {
};
goog.dom.browserrange.AbstractRange.prototype.containsRange = function $goog$dom$browserrange$AbstractRange$$containsRange$(abstractRange, opt_allowPartial) {
  var checkPartial = opt_allowPartial && !abstractRange.isCollapsed(), range = abstractRange.getBrowserRange(), start = goog.dom.RangeEndpoint.START, end = goog.dom.RangeEndpoint.END;
  try {
    return checkPartial ? 0 <= this.compareBrowserRangeEndpoints(range, end, start) && 0 >= this.compareBrowserRangeEndpoints(range, start, end) : 0 <= this.compareBrowserRangeEndpoints(range, end, end) && 0 >= this.compareBrowserRangeEndpoints(range, start, start)
  }catch(e) {
    if(!goog.userAgent.IE) {
      throw e;
    }
    return!1
  }
};
goog.dom.browserrange.AbstractRange.prototype.containsNode = function $goog$dom$browserrange$AbstractRange$$containsNode$(node, opt_allowPartial) {
  return this.containsRange(goog.dom.browserrange.createRangeFromNodeContents(node), opt_allowPartial)
};
goog.dom.browserrange.AbstractRange.prototype.__iterator__ = function $goog$dom$browserrange$AbstractRange$$__iterator__$() {
  return new goog.dom.TextRangeIterator(this.getStartNode(), this.getStartOffset(), this.getEndNode(), this.getEndOffset())
};
goog.dom.browserrange.W3cRange = function $goog$dom$browserrange$W3cRange$(range) {
  this.range_ = range
};
goog.inherits(goog.dom.browserrange.W3cRange, goog.dom.browserrange.AbstractRange);
goog.dom.browserrange.W3cRange.getBrowserRangeForNode = function $goog$dom$browserrange$W3cRange$getBrowserRangeForNode$(node) {
  var nodeRange = goog.dom.getOwnerDocument(node).createRange();
  if(node.nodeType == goog.dom.NodeType.TEXT) {
    nodeRange.setStart(node, 0), nodeRange.setEnd(node, node.length)
  }else {
    if(goog.dom.browserrange.canContainRangeEndpoint(node)) {
      for(var tempNode, leaf = node;(tempNode = leaf.firstChild) && goog.dom.browserrange.canContainRangeEndpoint(tempNode);) {
        leaf = tempNode
      }
      nodeRange.setStart(leaf, 0);
      for(leaf = node;(tempNode = leaf.lastChild) && goog.dom.browserrange.canContainRangeEndpoint(tempNode);) {
        leaf = tempNode
      }
      nodeRange.setEnd(leaf, leaf.nodeType == goog.dom.NodeType.ELEMENT ? leaf.childNodes.length : leaf.length)
    }else {
      var rangeParent = node.parentNode, rangeStartOffset = goog.array.indexOf(rangeParent.childNodes, node);
      nodeRange.setStart(rangeParent, rangeStartOffset);
      nodeRange.setEnd(rangeParent, rangeStartOffset + 1)
    }
  }
  return nodeRange
};
goog.dom.browserrange.W3cRange.getBrowserRangeForNodes = function $goog$dom$browserrange$W3cRange$getBrowserRangeForNodes$(startNode, startOffset, endNode, endOffset) {
  var nodeRange = goog.dom.getOwnerDocument(startNode).createRange();
  nodeRange.setStart(startNode, startOffset);
  nodeRange.setEnd(endNode, endOffset);
  return nodeRange
};
goog.dom.browserrange.W3cRange.createFromNodeContents = function $goog$dom$browserrange$W3cRange$createFromNodeContents$(node) {
  return new goog.dom.browserrange.W3cRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNode(node))
};
goog.dom.browserrange.W3cRange.createFromNodes = function $goog$dom$browserrange$W3cRange$createFromNodes$(startNode, startOffset, endNode, endOffset) {
  return new goog.dom.browserrange.W3cRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNodes(startNode, startOffset, endNode, endOffset))
};
goog.dom.browserrange.W3cRange.prototype.clone = function $goog$dom$browserrange$W3cRange$$clone$() {
  return new this.constructor(this.range_.cloneRange())
};
goog.dom.browserrange.W3cRange.prototype.getBrowserRange = function $goog$dom$browserrange$W3cRange$$getBrowserRange$() {
  return this.range_
};
goog.dom.browserrange.W3cRange.prototype.getContainer = function $goog$dom$browserrange$W3cRange$$getContainer$() {
  return this.range_.commonAncestorContainer
};
goog.dom.browserrange.W3cRange.prototype.getStartNode = function $goog$dom$browserrange$W3cRange$$getStartNode$() {
  return this.range_.startContainer
};
goog.dom.browserrange.W3cRange.prototype.getStartOffset = function $goog$dom$browserrange$W3cRange$$getStartOffset$() {
  return this.range_.startOffset
};
goog.dom.browserrange.W3cRange.prototype.getEndNode = function $goog$dom$browserrange$W3cRange$$getEndNode$() {
  return this.range_.endContainer
};
goog.dom.browserrange.W3cRange.prototype.getEndOffset = function $goog$dom$browserrange$W3cRange$$getEndOffset$() {
  return this.range_.endOffset
};
goog.dom.browserrange.W3cRange.prototype.compareBrowserRangeEndpoints = function $goog$dom$browserrange$W3cRange$$compareBrowserRangeEndpoints$(range, thisEndpoint, otherEndpoint) {
  return this.range_.compareBoundaryPoints(otherEndpoint == goog.dom.RangeEndpoint.START ? thisEndpoint == goog.dom.RangeEndpoint.START ? goog.global.Range.START_TO_START : goog.global.Range.START_TO_END : thisEndpoint == goog.dom.RangeEndpoint.START ? goog.global.Range.END_TO_START : goog.global.Range.END_TO_END, range)
};
goog.dom.browserrange.W3cRange.prototype.isCollapsed = function $goog$dom$browserrange$W3cRange$$isCollapsed$() {
  return this.range_.collapsed
};
goog.dom.browserrange.W3cRange.prototype.getText = function $goog$dom$browserrange$W3cRange$$getText$() {
  return this.range_.toString()
};
goog.dom.browserrange.W3cRange.prototype.select = function $goog$dom$browserrange$W3cRange$$select$(reverse) {
  var win = goog.dom.getWindow(goog.dom.getOwnerDocument(this.getStartNode()));
  this.selectInternal(win.getSelection(), reverse)
};
goog.dom.browserrange.W3cRange.prototype.selectInternal = function $goog$dom$browserrange$W3cRange$$selectInternal$(selection) {
  selection.removeAllRanges();
  selection.addRange(this.range_)
};
goog.dom.browserrange.W3cRange.prototype.removeContents = function $goog$dom$browserrange$W3cRange$$removeContents$() {
  var range = this.range_;
  range.extractContents();
  if(range.startContainer.hasChildNodes()) {
    var rangeStartContainer = range.startContainer.childNodes[range.startOffset];
    if(rangeStartContainer) {
      var rangePrevious = rangeStartContainer.previousSibling;
      "" == goog.dom.getRawTextContent(rangeStartContainer) && goog.dom.removeNode(rangeStartContainer);
      rangePrevious && "" == goog.dom.getRawTextContent(rangePrevious) && goog.dom.removeNode(rangePrevious)
    }
  }
};
goog.dom.browserrange.W3cRange.prototype.insertNode = function $goog$dom$browserrange$W3cRange$$insertNode$(node, before) {
  var range = this.range_.cloneRange();
  range.collapse(before);
  range.insertNode(node);
  range.detach();
  return node
};
goog.dom.browserrange.W3cRange.prototype.surroundWithNodes = function $goog$dom$browserrange$W3cRange$$surroundWithNodes$(startNode, endNode) {
  var win = goog.dom.getWindow(goog.dom.getOwnerDocument(this.getStartNode())), selectionRange = goog.dom.Range.createFromWindow(win);
  if(selectionRange) {
    var sNode = selectionRange.getStartNode(), eNode = selectionRange.getEndNode(), sOffset = selectionRange.getStartOffset(), eOffset = selectionRange.getEndOffset()
  }
  var clone1 = this.range_.cloneRange(), clone2 = this.range_.cloneRange();
  clone1.collapse(!1);
  clone2.collapse(!0);
  clone1.insertNode(endNode);
  clone2.insertNode(startNode);
  clone1.detach();
  clone2.detach();
  if(selectionRange) {
    if(sNode.nodeType == goog.dom.NodeType.TEXT) {
      for(;sOffset > sNode.length;) {
        sOffset -= sNode.length;
        do {
          sNode = sNode.nextSibling
        }while(sNode == startNode || sNode == endNode)
      }
    }
    if(eNode.nodeType == goog.dom.NodeType.TEXT) {
      for(;eOffset > eNode.length;) {
        eOffset -= eNode.length;
        do {
          eNode = eNode.nextSibling
        }while(eNode == startNode || eNode == endNode)
      }
    }
    goog.dom.Range.createFromNodes(sNode, sOffset, eNode, eOffset).select()
  }
};
goog.dom.browserrange.W3cRange.prototype.collapse = function $goog$dom$browserrange$W3cRange$$collapse$(toStart) {
  this.range_.collapse(toStart)
};
goog.dom.browserrange.GeckoRange = function $goog$dom$browserrange$GeckoRange$(range) {
  goog.dom.browserrange.W3cRange.call(this, range)
};
goog.inherits(goog.dom.browserrange.GeckoRange, goog.dom.browserrange.W3cRange);
goog.dom.browserrange.GeckoRange.createFromNodeContents = function $goog$dom$browserrange$GeckoRange$createFromNodeContents$(node) {
  return new goog.dom.browserrange.GeckoRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNode(node))
};
goog.dom.browserrange.GeckoRange.createFromNodes = function $goog$dom$browserrange$GeckoRange$createFromNodes$(startNode, startOffset, endNode, endOffset) {
  return new goog.dom.browserrange.GeckoRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNodes(startNode, startOffset, endNode, endOffset))
};
goog.dom.browserrange.GeckoRange.prototype.selectInternal = function $goog$dom$browserrange$GeckoRange$$selectInternal$(selection, reversed) {
  var anchorNode = reversed ? this.getEndNode() : this.getStartNode(), anchorOffset = reversed ? this.getEndOffset() : this.getStartOffset(), focusNode = reversed ? this.getStartNode() : this.getEndNode(), focusOffset = reversed ? this.getStartOffset() : this.getEndOffset();
  selection.collapse(anchorNode, anchorOffset);
  (anchorNode != focusNode || anchorOffset != focusOffset) && selection.extend(focusNode, focusOffset)
};
goog.dom.NodeIterator = function $goog$dom$NodeIterator$(opt_node, opt_reversed, opt_unconstrained, opt_depth) {
  goog.dom.TagIterator.call(this, opt_node, opt_reversed, opt_unconstrained, null, opt_depth)
};
goog.inherits(goog.dom.NodeIterator, goog.dom.TagIterator);
goog.dom.NodeIterator.prototype.next = function $goog$dom$NodeIterator$$next$() {
  do {
    goog.dom.NodeIterator.superClass_.next.call(this)
  }while(this.isEndTag());
  return this.node
};
goog.dom.browserrange.IeRange = function $goog$dom$browserrange$IeRange$(range, doc) {
  this.range_ = range;
  this.doc_ = doc
};
goog.inherits(goog.dom.browserrange.IeRange, goog.dom.browserrange.AbstractRange);
goog.dom.browserrange.IeRange.logger_ = goog.debug.Logger.getLogger("goog.dom.browserrange.IeRange");
goog.dom.browserrange.IeRange.getBrowserRangeForNode_ = function $goog$dom$browserrange$IeRange$getBrowserRangeForNode_$(node) {
  var nodeRange = goog.dom.getOwnerDocument(node).body.createTextRange();
  if(node.nodeType == goog.dom.NodeType.ELEMENT) {
    nodeRange.moveToElementText(node), goog.dom.browserrange.canContainRangeEndpoint(node) && !node.childNodes.length && nodeRange.collapse(!1)
  }else {
    for(var offset = 0, sibling = node;sibling = sibling.previousSibling;) {
      var nodeType = sibling.nodeType;
      if(nodeType == goog.dom.NodeType.TEXT) {
        offset += sibling.length
      }else {
        if(nodeType == goog.dom.NodeType.ELEMENT) {
          nodeRange.moveToElementText(sibling);
          break
        }
      }
    }
    sibling || nodeRange.moveToElementText(node.parentNode);
    nodeRange.collapse(!sibling);
    offset && nodeRange.move("character", offset);
    nodeRange.moveEnd("character", node.length)
  }
  return nodeRange
};
goog.dom.browserrange.IeRange.getBrowserRangeForNodes_ = function $goog$dom$browserrange$IeRange$getBrowserRangeForNodes_$(startNode, startOffset, endNode, endOffset) {
  var child, collapse = !1;
  startNode.nodeType == goog.dom.NodeType.ELEMENT && (startOffset > startNode.childNodes.length && goog.dom.browserrange.IeRange.logger_.severe("Cannot have startOffset > startNode child count"), child = startNode.childNodes[startOffset], collapse = !child, startNode = child || startNode.lastChild || startNode, startOffset = 0);
  var leftRange = goog.dom.browserrange.IeRange.getBrowserRangeForNode_(startNode);
  startOffset && leftRange.move("character", startOffset);
  if(startNode == endNode && startOffset == endOffset) {
    return leftRange.collapse(!0), leftRange
  }
  collapse && leftRange.collapse(!1);
  collapse = !1;
  endNode.nodeType == goog.dom.NodeType.ELEMENT && (endOffset > endNode.childNodes.length && goog.dom.browserrange.IeRange.logger_.severe("Cannot have endOffset > endNode child count"), endNode = (child = endNode.childNodes[endOffset]) || endNode.lastChild || endNode, endOffset = 0, collapse = !child);
  var rightRange = goog.dom.browserrange.IeRange.getBrowserRangeForNode_(endNode);
  rightRange.collapse(!collapse);
  endOffset && rightRange.moveEnd("character", endOffset);
  leftRange.setEndPoint("EndToEnd", rightRange);
  return leftRange
};
goog.dom.browserrange.IeRange.createFromNodeContents = function $goog$dom$browserrange$IeRange$createFromNodeContents$(node) {
  var range = new goog.dom.browserrange.IeRange(goog.dom.browserrange.IeRange.getBrowserRangeForNode_(node), goog.dom.getOwnerDocument(node));
  if(goog.dom.browserrange.canContainRangeEndpoint(node)) {
    for(var tempNode, leaf = node;(tempNode = leaf.firstChild) && goog.dom.browserrange.canContainRangeEndpoint(tempNode);) {
      leaf = tempNode
    }
    range.startNode_ = leaf;
    range.startOffset_ = 0;
    for(leaf = node;(tempNode = leaf.lastChild) && goog.dom.browserrange.canContainRangeEndpoint(tempNode);) {
      leaf = tempNode
    }
    range.endNode_ = leaf;
    range.endOffset_ = leaf.nodeType == goog.dom.NodeType.ELEMENT ? leaf.childNodes.length : leaf.length;
    range.parentNode_ = node
  }else {
    range.startNode_ = range.endNode_ = range.parentNode_ = node.parentNode, range.startOffset_ = goog.array.indexOf(range.parentNode_.childNodes, node), range.endOffset_ = range.startOffset_ + 1
  }
  return range
};
goog.dom.browserrange.IeRange.createFromNodes = function $goog$dom$browserrange$IeRange$createFromNodes$(startNode, startOffset, endNode, endOffset) {
  var range = new goog.dom.browserrange.IeRange(goog.dom.browserrange.IeRange.getBrowserRangeForNodes_(startNode, startOffset, endNode, endOffset), goog.dom.getOwnerDocument(startNode));
  range.startNode_ = startNode;
  range.startOffset_ = startOffset;
  range.endNode_ = endNode;
  range.endOffset_ = endOffset;
  return range
};
goog.dom.browserrange.IeRange.prototype.parentNode_ = null;
goog.dom.browserrange.IeRange.prototype.startNode_ = null;
goog.dom.browserrange.IeRange.prototype.endNode_ = null;
goog.dom.browserrange.IeRange.prototype.startOffset_ = -1;
goog.dom.browserrange.IeRange.prototype.endOffset_ = -1;
goog.dom.browserrange.IeRange.prototype.clone = function $goog$dom$browserrange$IeRange$$clone$() {
  var range = new goog.dom.browserrange.IeRange(this.range_.duplicate(), this.doc_);
  range.parentNode_ = this.parentNode_;
  range.startNode_ = this.startNode_;
  range.endNode_ = this.endNode_;
  return range
};
goog.dom.browserrange.IeRange.prototype.getBrowserRange = function $goog$dom$browserrange$IeRange$$getBrowserRange$() {
  return this.range_
};
goog.dom.browserrange.IeRange.prototype.clearCachedValues_ = function $goog$dom$browserrange$IeRange$$clearCachedValues_$() {
  this.parentNode_ = this.startNode_ = this.endNode_ = null;
  this.startOffset_ = this.endOffset_ = -1
};
goog.dom.browserrange.IeRange.prototype.getContainer = function $goog$dom$browserrange$IeRange$$getContainer$() {
  if(!this.parentNode_) {
    var selectText = this.range_.text, range = this.range_.duplicate(), rightTrimmedSelectText = selectText.replace(/ +$/, ""), numSpacesAtEnd = selectText.length - rightTrimmedSelectText.length;
    numSpacesAtEnd && range.moveEnd("character", -numSpacesAtEnd);
    var parent = range.parentElement(), htmlText = range.htmlText, htmlTextLen = goog.string.stripNewlines(htmlText).length;
    if(this.isCollapsed() && 0 < htmlTextLen) {
      return this.parentNode_ = parent
    }
    for(;htmlTextLen > goog.string.stripNewlines(parent.outerHTML).length;) {
      parent = parent.parentNode
    }
    for(;1 == parent.childNodes.length && parent.innerText == goog.dom.browserrange.IeRange.getNodeText_(parent.firstChild) && goog.dom.browserrange.canContainRangeEndpoint(parent.firstChild);) {
      parent = parent.firstChild
    }
    0 == selectText.length && (parent = this.findDeepestContainer_(parent));
    this.parentNode_ = parent
  }
  return this.parentNode_
};
goog.dom.browserrange.IeRange.prototype.findDeepestContainer_ = function $goog$dom$browserrange$IeRange$$findDeepestContainer_$(node) {
  for(var childNodes = node.childNodes, i = 0, len = childNodes.length;i < len;i++) {
    var child = childNodes[i];
    if(goog.dom.browserrange.canContainRangeEndpoint(child)) {
      var childRange = goog.dom.browserrange.IeRange.getBrowserRangeForNode_(child), start = goog.dom.RangeEndpoint.START, end = goog.dom.RangeEndpoint.END, isChildRangeErratic = childRange.htmlText != child.outerHTML, isNativeInRangeErratic = this.isCollapsed() && isChildRangeErratic, inChildRange = isNativeInRangeErratic ? 0 <= this.compareBrowserRangeEndpoints(childRange, start, start) && 0 >= this.compareBrowserRangeEndpoints(childRange, start, end) : this.range_.inRange(childRange);
      if(inChildRange) {
        return this.findDeepestContainer_(child)
      }
    }
  }
  return node
};
goog.dom.browserrange.IeRange.prototype.getStartNode = function $goog$dom$browserrange$IeRange$$getStartNode$() {
  this.startNode_ || (this.startNode_ = this.getEndpointNode_(goog.dom.RangeEndpoint.START), this.isCollapsed() && (this.endNode_ = this.startNode_));
  return this.startNode_
};
goog.dom.browserrange.IeRange.prototype.getStartOffset = function $goog$dom$browserrange$IeRange$$getStartOffset$() {
  0 > this.startOffset_ && (this.startOffset_ = this.getOffset_(goog.dom.RangeEndpoint.START), this.isCollapsed() && (this.endOffset_ = this.startOffset_));
  return this.startOffset_
};
goog.dom.browserrange.IeRange.prototype.getEndNode = function $goog$dom$browserrange$IeRange$$getEndNode$() {
  if(this.isCollapsed()) {
    return this.getStartNode()
  }
  this.endNode_ || (this.endNode_ = this.getEndpointNode_(goog.dom.RangeEndpoint.END));
  return this.endNode_
};
goog.dom.browserrange.IeRange.prototype.getEndOffset = function $goog$dom$browserrange$IeRange$$getEndOffset$() {
  if(this.isCollapsed()) {
    return this.getStartOffset()
  }
  0 > this.endOffset_ && (this.endOffset_ = this.getOffset_(goog.dom.RangeEndpoint.END), this.isCollapsed() && (this.startOffset_ = this.endOffset_));
  return this.endOffset_
};
goog.dom.browserrange.IeRange.prototype.compareBrowserRangeEndpoints = function $goog$dom$browserrange$IeRange$$compareBrowserRangeEndpoints$(range, thisEndpoint, otherEndpoint) {
  return this.range_.compareEndPoints((thisEndpoint == goog.dom.RangeEndpoint.START ? "Start" : "End") + "To" + (otherEndpoint == goog.dom.RangeEndpoint.START ? "Start" : "End"), range)
};
goog.dom.browserrange.IeRange.prototype.getEndpointNode_ = function $goog$dom$browserrange$IeRange$$getEndpointNode_$(endpoint, opt_node) {
  var node = opt_node || this.getContainer();
  if(!node || !node.firstChild) {
    return node
  }
  for(var start = goog.dom.RangeEndpoint.START, end = goog.dom.RangeEndpoint.END, isStartEndpoint = endpoint == start, j = 0, length = node.childNodes.length;j < length;j++) {
    var i = isStartEndpoint ? j : length - j - 1, child = node.childNodes[i], childRange;
    try {
      childRange = goog.dom.browserrange.createRangeFromNodeContents(child)
    }catch(e) {
      continue
    }
    var ieRange = childRange.getBrowserRange();
    if(this.isCollapsed()) {
      if(goog.dom.browserrange.canContainRangeEndpoint(child)) {
        if(childRange.containsRange(this)) {
          return this.getEndpointNode_(endpoint, child)
        }
      }else {
        if(0 == this.compareBrowserRangeEndpoints(ieRange, start, start)) {
          this.startOffset_ = this.endOffset_ = i;
          break
        }
      }
    }else {
      if(this.containsRange(childRange)) {
        if(!goog.dom.browserrange.canContainRangeEndpoint(child)) {
          isStartEndpoint ? this.startOffset_ = i : this.endOffset_ = i + 1;
          break
        }
        return this.getEndpointNode_(endpoint, child)
      }
      if(0 > this.compareBrowserRangeEndpoints(ieRange, start, end) && 0 < this.compareBrowserRangeEndpoints(ieRange, end, start)) {
        return this.getEndpointNode_(endpoint, child)
      }
    }
  }
  return node
};
goog.dom.browserrange.IeRange.prototype.compareNodeEndpoints_ = function $goog$dom$browserrange$IeRange$$compareNodeEndpoints_$(node, thisEndpoint, otherEndpoint) {
  return this.range_.compareEndPoints((thisEndpoint == goog.dom.RangeEndpoint.START ? "Start" : "End") + "To" + (otherEndpoint == goog.dom.RangeEndpoint.START ? "Start" : "End"), goog.dom.browserrange.createRangeFromNodeContents(node).getBrowserRange())
};
goog.dom.browserrange.IeRange.prototype.getOffset_ = function $goog$dom$browserrange$IeRange$$getOffset_$(endpoint, opt_container) {
  var isStartEndpoint = endpoint == goog.dom.RangeEndpoint.START, container = opt_container || (isStartEndpoint ? this.getStartNode() : this.getEndNode());
  if(container.nodeType == goog.dom.NodeType.ELEMENT) {
    for(var children = container.childNodes, len = children.length, edge = isStartEndpoint ? 0 : len - 1, sign = isStartEndpoint ? 1 : -1, i = edge;0 <= i && i < len;i += sign) {
      var child = children[i];
      if(!goog.dom.browserrange.canContainRangeEndpoint(child)) {
        var endPointCompare = this.compareNodeEndpoints_(child, endpoint, endpoint);
        if(0 == endPointCompare) {
          return isStartEndpoint ? i : i + 1
        }
      }
    }
    return-1 == i ? 0 : i
  }
  var range = this.range_.duplicate(), nodeRange = goog.dom.browserrange.IeRange.getBrowserRangeForNode_(container);
  range.setEndPoint(isStartEndpoint ? "EndToEnd" : "StartToStart", nodeRange);
  var rangeLength = range.text.length;
  return isStartEndpoint ? container.length - rangeLength : rangeLength
};
goog.dom.browserrange.IeRange.getNodeText_ = function $goog$dom$browserrange$IeRange$getNodeText_$(node) {
  return node.nodeType == goog.dom.NodeType.TEXT ? node.nodeValue : node.innerText
};
goog.dom.browserrange.IeRange.prototype.isRangeInDocument = function $goog$dom$browserrange$IeRange$$isRangeInDocument$() {
  var range = this.doc_.body.createTextRange();
  range.moveToElementText(this.doc_.body);
  return this.containsRange(new goog.dom.browserrange.IeRange(range, this.doc_), !0)
};
goog.dom.browserrange.IeRange.prototype.isCollapsed = function $goog$dom$browserrange$IeRange$$isCollapsed$() {
  return 0 == this.range_.compareEndPoints("StartToEnd", this.range_)
};
goog.dom.browserrange.IeRange.prototype.getText = function $goog$dom$browserrange$IeRange$$getText$() {
  return this.range_.text
};
goog.dom.browserrange.IeRange.prototype.select = function $goog$dom$browserrange$IeRange$$select$() {
  this.range_.select()
};
goog.dom.browserrange.IeRange.prototype.removeContents = function $goog$dom$browserrange$IeRange$$removeContents$() {
  if(!this.isCollapsed() && this.range_.htmlText) {
    var startNode = this.getStartNode(), endNode = this.getEndNode(), oldText = this.range_.text, clone = this.range_.duplicate();
    clone.moveStart("character", 1);
    clone.moveStart("character", -1);
    clone.text == oldText && (this.range_ = clone);
    this.range_.text = "";
    this.clearCachedValues_();
    var newStartNode = this.getStartNode(), newStartOffset = this.getStartOffset();
    try {
      var sibling = startNode.nextSibling;
      startNode == endNode && startNode.parentNode && startNode.nodeType == goog.dom.NodeType.TEXT && sibling && sibling.nodeType == goog.dom.NodeType.TEXT && (startNode.nodeValue += sibling.nodeValue, goog.dom.removeNode(sibling), this.range_ = goog.dom.browserrange.IeRange.getBrowserRangeForNode_(newStartNode), this.range_.move("character", newStartOffset), this.clearCachedValues_())
    }catch(e) {
    }
  }
};
goog.dom.browserrange.IeRange.getDomHelper_ = function $goog$dom$browserrange$IeRange$getDomHelper_$(range) {
  return goog.dom.getDomHelper(range.parentElement())
};
goog.dom.browserrange.IeRange.pasteElement_ = function $goog$dom$browserrange$IeRange$pasteElement_$(range, element, opt_domHelper) {
  var opt_domHelper = opt_domHelper || goog.dom.browserrange.IeRange.getDomHelper_(range), id, originalId = id = element.id;
  id || (id = element.id = goog.string.createUniqueString());
  range.pasteHTML(element.outerHTML);
  (element = opt_domHelper.getElement(id)) && (originalId || element.removeAttribute("id"));
  return element
};
goog.dom.browserrange.IeRange.insertNode_ = function $goog$dom$browserrange$IeRange$insertNode_$(clone, node, before, opt_domHelper) {
  var opt_domHelper = opt_domHelper || goog.dom.browserrange.IeRange.getDomHelper_(clone), isNonElement;
  node.nodeType != goog.dom.NodeType.ELEMENT && (isNonElement = !0, node = opt_domHelper.createDom(goog.dom.TagName.DIV, null, node));
  clone.collapse(before);
  node = goog.dom.browserrange.IeRange.pasteElement_(clone, node, opt_domHelper);
  if(isNonElement) {
    var newNonElement = node.firstChild;
    opt_domHelper.flattenElement(node);
    node = newNonElement
  }
  return node
};
goog.dom.browserrange.IeRange.prototype.insertNode = function $goog$dom$browserrange$IeRange$$insertNode$(node, before) {
  var output = goog.dom.browserrange.IeRange.insertNode_(this.range_.duplicate(), node, before);
  this.clearCachedValues_();
  return output
};
goog.dom.browserrange.IeRange.prototype.surroundWithNodes = function $goog$dom$browserrange$IeRange$$surroundWithNodes$(startNode, endNode) {
  var clone1 = this.range_.duplicate(), clone2 = this.range_.duplicate();
  goog.dom.browserrange.IeRange.insertNode_(clone1, startNode, !0);
  goog.dom.browserrange.IeRange.insertNode_(clone2, endNode, !1);
  this.clearCachedValues_()
};
goog.dom.browserrange.IeRange.prototype.collapse = function $goog$dom$browserrange$IeRange$$collapse$(toStart) {
  this.range_.collapse(toStart);
  toStart ? (this.endNode_ = this.startNode_, this.endOffset_ = this.startOffset_) : (this.startNode_ = this.endNode_, this.startOffset_ = this.endOffset_)
};
goog.dom.browserrange.OperaRange = function $goog$dom$browserrange$OperaRange$(range) {
  goog.dom.browserrange.W3cRange.call(this, range)
};
goog.inherits(goog.dom.browserrange.OperaRange, goog.dom.browserrange.W3cRange);
goog.dom.browserrange.OperaRange.createFromNodeContents = function $goog$dom$browserrange$OperaRange$createFromNodeContents$(node) {
  return new goog.dom.browserrange.OperaRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNode(node))
};
goog.dom.browserrange.OperaRange.createFromNodes = function $goog$dom$browserrange$OperaRange$createFromNodes$(startNode, startOffset, endNode, endOffset) {
  return new goog.dom.browserrange.OperaRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNodes(startNode, startOffset, endNode, endOffset))
};
goog.dom.browserrange.OperaRange.prototype.selectInternal = function $goog$dom$browserrange$OperaRange$$selectInternal$(selection) {
  selection.collapse(this.getStartNode(), this.getStartOffset());
  (this.getEndNode() != this.getStartNode() || this.getEndOffset() != this.getStartOffset()) && selection.extend(this.getEndNode(), this.getEndOffset());
  0 == selection.rangeCount && selection.addRange(this.range_)
};
goog.dom.browserrange.WebKitRange = function $goog$dom$browserrange$WebKitRange$(range) {
  goog.dom.browserrange.W3cRange.call(this, range)
};
goog.inherits(goog.dom.browserrange.WebKitRange, goog.dom.browserrange.W3cRange);
goog.dom.browserrange.WebKitRange.createFromNodeContents = function $goog$dom$browserrange$WebKitRange$createFromNodeContents$(node) {
  return new goog.dom.browserrange.WebKitRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNode(node))
};
goog.dom.browserrange.WebKitRange.createFromNodes = function $goog$dom$browserrange$WebKitRange$createFromNodes$(startNode, startOffset, endNode, endOffset) {
  return new goog.dom.browserrange.WebKitRange(goog.dom.browserrange.W3cRange.getBrowserRangeForNodes(startNode, startOffset, endNode, endOffset))
};
goog.dom.browserrange.WebKitRange.prototype.compareBrowserRangeEndpoints = function $goog$dom$browserrange$WebKitRange$$compareBrowserRangeEndpoints$(range, thisEndpoint, otherEndpoint) {
  return goog.userAgent.isVersion("528") ? goog.dom.browserrange.WebKitRange.superClass_.compareBrowserRangeEndpoints.call(this, range, thisEndpoint, otherEndpoint) : this.range_.compareBoundaryPoints(otherEndpoint == goog.dom.RangeEndpoint.START ? thisEndpoint == goog.dom.RangeEndpoint.START ? goog.global.Range.START_TO_START : goog.global.Range.END_TO_START : thisEndpoint == goog.dom.RangeEndpoint.START ? goog.global.Range.START_TO_END : goog.global.Range.END_TO_END, range)
};
goog.dom.browserrange.WebKitRange.prototype.selectInternal = function $goog$dom$browserrange$WebKitRange$$selectInternal$(selection, reversed) {
  selection.removeAllRanges();
  reversed ? selection.setBaseAndExtent(this.getEndNode(), this.getEndOffset(), this.getStartNode(), this.getStartOffset()) : selection.setBaseAndExtent(this.getStartNode(), this.getStartOffset(), this.getEndNode(), this.getEndOffset())
};
goog.dom.browserrange.Error = {NOT_IMPLEMENTED:"Not Implemented"};
goog.dom.browserrange.createRange = function $goog$dom$browserrange$createRange$(range) {
  return goog.userAgent.IE && !goog.userAgent.isDocumentMode(9) ? new goog.dom.browserrange.IeRange(range, goog.dom.getOwnerDocument(range.parentElement())) : goog.userAgent.WEBKIT ? new goog.dom.browserrange.WebKitRange(range) : goog.userAgent.GECKO ? new goog.dom.browserrange.GeckoRange(range) : goog.userAgent.OPERA ? new goog.dom.browserrange.OperaRange(range) : new goog.dom.browserrange.W3cRange(range)
};
goog.dom.browserrange.createRangeFromNodeContents = function $goog$dom$browserrange$createRangeFromNodeContents$(node) {
  return goog.userAgent.IE && !goog.userAgent.isDocumentMode(9) ? goog.dom.browserrange.IeRange.createFromNodeContents(node) : goog.userAgent.WEBKIT ? goog.dom.browserrange.WebKitRange.createFromNodeContents(node) : goog.userAgent.GECKO ? goog.dom.browserrange.GeckoRange.createFromNodeContents(node) : goog.userAgent.OPERA ? goog.dom.browserrange.OperaRange.createFromNodeContents(node) : goog.dom.browserrange.W3cRange.createFromNodeContents(node)
};
goog.dom.browserrange.createRangeFromNodes = function $goog$dom$browserrange$createRangeFromNodes$(startNode, startOffset, endNode, endOffset) {
  return goog.userAgent.IE && !goog.userAgent.isDocumentMode(9) ? goog.dom.browserrange.IeRange.createFromNodes(startNode, startOffset, endNode, endOffset) : goog.userAgent.WEBKIT ? goog.dom.browserrange.WebKitRange.createFromNodes(startNode, startOffset, endNode, endOffset) : goog.userAgent.GECKO ? goog.dom.browserrange.GeckoRange.createFromNodes(startNode, startOffset, endNode, endOffset) : goog.userAgent.OPERA ? goog.dom.browserrange.OperaRange.createFromNodes(startNode, startOffset, endNode, 
  endOffset) : goog.dom.browserrange.W3cRange.createFromNodes(startNode, startOffset, endNode, endOffset)
};
goog.dom.browserrange.canContainRangeEndpoint = function $goog$dom$browserrange$canContainRangeEndpoint$(node) {
  return goog.dom.canHaveChildren(node) || node.nodeType == goog.dom.NodeType.TEXT
};
goog.dom.TextRange = function $goog$dom$TextRange$() {
};
goog.inherits(goog.dom.TextRange, goog.dom.AbstractRange);
goog.dom.TextRange.createFromBrowserRange = function $goog$dom$TextRange$createFromBrowserRange$(range, opt_isReversed) {
  return goog.dom.TextRange.createFromBrowserRangeWrapper_(goog.dom.browserrange.createRange(range), opt_isReversed)
};
goog.dom.TextRange.createFromBrowserRangeWrapper_ = function $goog$dom$TextRange$createFromBrowserRangeWrapper_$(browserRange, opt_isReversed) {
  var range = new goog.dom.TextRange;
  range.browserRangeWrapper_ = browserRange;
  range.isReversed_ = !!opt_isReversed;
  return range
};
goog.dom.TextRange.createFromNodeContents = function $goog$dom$TextRange$createFromNodeContents$(node, opt_isReversed) {
  return goog.dom.TextRange.createFromBrowserRangeWrapper_(goog.dom.browserrange.createRangeFromNodeContents(node), opt_isReversed)
};
goog.dom.TextRange.createFromNodes = function $goog$dom$TextRange$createFromNodes$(anchorNode, anchorOffset, focusNode, focusOffset) {
  var range = new goog.dom.TextRange;
  range.isReversed_ = goog.dom.Range.isReversed(anchorNode, anchorOffset, focusNode, focusOffset);
  if("BR" == anchorNode.tagName) {
    var parent = anchorNode.parentNode, anchorOffset = goog.array.indexOf(parent.childNodes, anchorNode), anchorNode = parent
  }
  "BR" == focusNode.tagName && (parent = focusNode.parentNode, focusOffset = goog.array.indexOf(parent.childNodes, focusNode), focusNode = parent);
  range.isReversed_ ? (range.startNode_ = focusNode, range.startOffset_ = focusOffset, range.endNode_ = anchorNode, range.endOffset_ = anchorOffset) : (range.startNode_ = anchorNode, range.startOffset_ = anchorOffset, range.endNode_ = focusNode, range.endOffset_ = focusOffset);
  return range
};
goog.dom.TextRange.prototype.browserRangeWrapper_ = null;
goog.dom.TextRange.prototype.startNode_ = null;
goog.dom.TextRange.prototype.startOffset_ = null;
goog.dom.TextRange.prototype.endNode_ = null;
goog.dom.TextRange.prototype.endOffset_ = null;
goog.dom.TextRange.prototype.isReversed_ = !1;
goog.dom.TextRange.prototype.clone = function $goog$dom$TextRange$$clone$() {
  var range = new goog.dom.TextRange;
  range.browserRangeWrapper_ = this.browserRangeWrapper_;
  range.startNode_ = this.startNode_;
  range.startOffset_ = this.startOffset_;
  range.endNode_ = this.endNode_;
  range.endOffset_ = this.endOffset_;
  range.isReversed_ = this.isReversed_;
  return range
};
goog.dom.TextRange.prototype.getType = function $goog$dom$TextRange$$getType$() {
  return goog.dom.RangeType.TEXT
};
goog.dom.TextRange.prototype.getBrowserRangeObject = function $goog$dom$TextRange$$getBrowserRangeObject$() {
  return this.getBrowserRangeWrapper_().getBrowserRange()
};
goog.dom.TextRange.prototype.clearCachedValues_ = function $goog$dom$TextRange$$clearCachedValues_$() {
  this.startNode_ = this.startOffset_ = this.endNode_ = this.endOffset_ = null
};
goog.dom.TextRange.prototype.getTextRangeCount = function $goog$dom$TextRange$$getTextRangeCount$() {
  return 1
};
goog.dom.TextRange.prototype.getTextRange = function $goog$dom$TextRange$$getTextRange$() {
  return this
};
goog.dom.TextRange.prototype.getBrowserRangeWrapper_ = function $goog$dom$TextRange$$getBrowserRangeWrapper_$() {
  return this.browserRangeWrapper_ || (this.browserRangeWrapper_ = goog.dom.browserrange.createRangeFromNodes(this.getStartNode(), this.getStartOffset(), this.getEndNode(), this.getEndOffset()))
};
goog.dom.TextRange.prototype.getContainer = function $goog$dom$TextRange$$getContainer$() {
  return this.getBrowserRangeWrapper_().getContainer()
};
goog.dom.TextRange.prototype.getStartNode = function $goog$dom$TextRange$$getStartNode$() {
  return this.startNode_ || (this.startNode_ = this.getBrowserRangeWrapper_().getStartNode())
};
goog.dom.TextRange.prototype.getStartOffset = function $goog$dom$TextRange$$getStartOffset$() {
  return null != this.startOffset_ ? this.startOffset_ : this.startOffset_ = this.getBrowserRangeWrapper_().getStartOffset()
};
goog.dom.TextRange.prototype.getEndNode = function $goog$dom$TextRange$$getEndNode$() {
  return this.endNode_ || (this.endNode_ = this.getBrowserRangeWrapper_().getEndNode())
};
goog.dom.TextRange.prototype.getEndOffset = function $goog$dom$TextRange$$getEndOffset$() {
  return null != this.endOffset_ ? this.endOffset_ : this.endOffset_ = this.getBrowserRangeWrapper_().getEndOffset()
};
goog.dom.TextRange.prototype.isReversed = function $goog$dom$TextRange$$isReversed$() {
  return this.isReversed_
};
goog.dom.TextRange.prototype.containsRange = function $goog$dom$TextRange$$containsRange$(otherRange, opt_allowPartial) {
  var otherRangeType = otherRange.getType();
  if(otherRangeType == goog.dom.RangeType.TEXT) {
    return this.getBrowserRangeWrapper_().containsRange(otherRange.getBrowserRangeWrapper_(), opt_allowPartial)
  }
  if(otherRangeType == goog.dom.RangeType.CONTROL) {
    var elements = otherRange.getElements(), fn = opt_allowPartial ? goog.array.some : goog.array.every;
    return fn(elements, function(el) {
      return this.containsNode(el, opt_allowPartial)
    }, this)
  }
  return!1
};
goog.dom.TextRange.isAttachedNode = function $goog$dom$TextRange$isAttachedNode$(node) {
  if(goog.userAgent.IE && !goog.userAgent.isDocumentMode(9)) {
    var returnValue = !1;
    try {
      returnValue = node.parentNode
    }catch(e) {
    }
    return!!returnValue
  }
  return goog.dom.contains(node.ownerDocument.body, node)
};
goog.dom.TextRange.prototype.isRangeInDocument = function $goog$dom$TextRange$$isRangeInDocument$() {
  return(!this.startNode_ || goog.dom.TextRange.isAttachedNode(this.startNode_)) && (!this.endNode_ || goog.dom.TextRange.isAttachedNode(this.endNode_)) && (!(goog.userAgent.IE && !goog.userAgent.isDocumentMode(9)) || this.getBrowserRangeWrapper_().isRangeInDocument())
};
goog.dom.TextRange.prototype.isCollapsed = function $goog$dom$TextRange$$isCollapsed$() {
  return this.getBrowserRangeWrapper_().isCollapsed()
};
goog.dom.TextRange.prototype.getText = function $goog$dom$TextRange$$getText$() {
  return this.getBrowserRangeWrapper_().getText()
};
goog.dom.TextRange.prototype.__iterator__ = function $goog$dom$TextRange$$__iterator__$() {
  return new goog.dom.TextRangeIterator(this.getStartNode(), this.getStartOffset(), this.getEndNode(), this.getEndOffset())
};
goog.dom.TextRange.prototype.select = function $goog$dom$TextRange$$select$() {
  this.getBrowserRangeWrapper_().select(this.isReversed_)
};
goog.dom.TextRange.prototype.removeContents = function $goog$dom$TextRange$$removeContents$() {
  this.getBrowserRangeWrapper_().removeContents();
  this.clearCachedValues_()
};
goog.dom.TextRange.prototype.insertNode = function $goog$dom$TextRange$$insertNode$(node, before) {
  var output = this.getBrowserRangeWrapper_().insertNode(node, before);
  this.clearCachedValues_();
  return output
};
goog.dom.TextRange.prototype.surroundWithNodes = function $goog$dom$TextRange$$surroundWithNodes$(startNode, endNode) {
  this.getBrowserRangeWrapper_().surroundWithNodes(startNode, endNode);
  this.clearCachedValues_()
};
goog.dom.TextRange.prototype.saveUsingDom = function $goog$dom$TextRange$$saveUsingDom$() {
  return new goog.dom.DomSavedTextRange_(this)
};
goog.dom.TextRange.prototype.collapse = function $goog$dom$TextRange$$collapse$(toAnchor) {
  var toStart = this.isReversed() ? !toAnchor : toAnchor;
  this.browserRangeWrapper_ && this.browserRangeWrapper_.collapse(toStart);
  toStart ? (this.endNode_ = this.startNode_, this.endOffset_ = this.startOffset_) : (this.startNode_ = this.endNode_, this.startOffset_ = this.endOffset_);
  this.isReversed_ = !1
};
goog.dom.DomSavedTextRange_ = function $goog$dom$DomSavedTextRange_$(range) {
  this.anchorNode_ = range.getAnchorNode();
  this.anchorOffset_ = range.getAnchorOffset();
  this.focusNode_ = range.getFocusNode();
  this.focusOffset_ = range.getFocusOffset()
};
goog.inherits(goog.dom.DomSavedTextRange_, goog.dom.SavedRange);
goog.dom.DomSavedTextRange_.prototype.restoreInternal = function $goog$dom$DomSavedTextRange_$$restoreInternal$() {
  return goog.dom.Range.createFromNodes(this.anchorNode_, this.anchorOffset_, this.focusNode_, this.focusOffset_)
};
goog.dom.DomSavedTextRange_.prototype.disposeInternal = function $goog$dom$DomSavedTextRange_$$disposeInternal$() {
  goog.dom.DomSavedTextRange_.superClass_.disposeInternal.call(this);
  this.focusNode_ = this.anchorNode_ = null
};
goog.dom.ControlRange = function $goog$dom$ControlRange$() {
};
goog.inherits(goog.dom.ControlRange, goog.dom.AbstractMultiRange);
goog.dom.ControlRange.createFromBrowserRange = function $goog$dom$ControlRange$createFromBrowserRange$(controlRange) {
  var range = new goog.dom.ControlRange;
  range.range_ = controlRange;
  return range
};
goog.dom.ControlRange.createFromElements = function $goog$dom$ControlRange$createFromElements$(var_args) {
  for(var range = goog.dom.getOwnerDocument(arguments[0]).body.createControlRange(), i = 0, len = arguments.length;i < len;i++) {
    range.addElement(arguments[i])
  }
  return goog.dom.ControlRange.createFromBrowserRange(range)
};
goog.dom.ControlRange.prototype.range_ = null;
goog.dom.ControlRange.prototype.elements_ = null;
goog.dom.ControlRange.prototype.sortedElements_ = null;
goog.dom.ControlRange.prototype.clearCachedValues_ = function $goog$dom$ControlRange$$clearCachedValues_$() {
  this.sortedElements_ = this.elements_ = null
};
goog.dom.ControlRange.prototype.clone = function $goog$dom$ControlRange$$clone$() {
  return goog.dom.ControlRange.createFromElements.apply(this, this.getElements())
};
goog.dom.ControlRange.prototype.getType = function $goog$dom$ControlRange$$getType$() {
  return goog.dom.RangeType.CONTROL
};
goog.dom.ControlRange.prototype.getBrowserRangeObject = function $goog$dom$ControlRange$$getBrowserRangeObject$() {
  return this.range_ || document.body.createControlRange()
};
goog.dom.ControlRange.prototype.getTextRangeCount = function $goog$dom$ControlRange$$getTextRangeCount$() {
  return this.range_ ? this.range_.length : 0
};
goog.dom.ControlRange.prototype.getTextRange = function $goog$dom$ControlRange$$getTextRange$(i) {
  return goog.dom.TextRange.createFromNodeContents(this.range_.item(i))
};
goog.dom.ControlRange.prototype.getContainer = function $goog$dom$ControlRange$$getContainer$() {
  return goog.dom.findCommonAncestor.apply(null, this.getElements())
};
goog.dom.ControlRange.prototype.getStartNode = function $goog$dom$ControlRange$$getStartNode$() {
  return this.getSortedElements()[0]
};
goog.dom.ControlRange.prototype.getStartOffset = function $goog$dom$ControlRange$$getStartOffset$() {
  return 0
};
goog.dom.ControlRange.prototype.getEndNode = function $goog$dom$ControlRange$$getEndNode$() {
  var sorted = this.getSortedElements(), startsLast = goog.array.peek(sorted);
  return goog.array.find(sorted, function(el) {
    return goog.dom.contains(el, startsLast)
  })
};
goog.dom.ControlRange.prototype.getEndOffset = function $goog$dom$ControlRange$$getEndOffset$() {
  return this.getEndNode().childNodes.length
};
goog.dom.ControlRange.prototype.getElements = function $goog$dom$ControlRange$$getElements$() {
  if(!this.elements_ && (this.elements_ = [], this.range_)) {
    for(var i = 0;i < this.range_.length;i++) {
      this.elements_.push(this.range_.item(i))
    }
  }
  return this.elements_
};
goog.dom.ControlRange.prototype.getSortedElements = function $goog$dom$ControlRange$$getSortedElements$() {
  this.sortedElements_ || (this.sortedElements_ = this.getElements().concat(), this.sortedElements_.sort(function(a, b) {
    return a.sourceIndex - b.sourceIndex
  }));
  return this.sortedElements_
};
goog.dom.ControlRange.prototype.isRangeInDocument = function $goog$dom$ControlRange$$isRangeInDocument$() {
  var returnValue = !1;
  try {
    returnValue = goog.array.every(this.getElements(), function(element) {
      return goog.userAgent.IE ? element.parentNode : goog.dom.contains(element.ownerDocument.body, element)
    })
  }catch(e) {
  }
  return returnValue
};
goog.dom.ControlRange.prototype.isCollapsed = function $goog$dom$ControlRange$$isCollapsed$() {
  return!this.range_ || !this.range_.length
};
goog.dom.ControlRange.prototype.getText = function $goog$dom$ControlRange$$getText$() {
  return""
};
goog.dom.ControlRange.prototype.__iterator__ = function $goog$dom$ControlRange$$__iterator__$() {
  return new goog.dom.ControlRangeIterator(this)
};
goog.dom.ControlRange.prototype.select = function $goog$dom$ControlRange$$select$() {
  this.range_ && this.range_.select()
};
goog.dom.ControlRange.prototype.removeContents = function $goog$dom$ControlRange$$removeContents$() {
  if(this.range_) {
    for(var nodes = [], i = 0, len = this.range_.length;i < len;i++) {
      nodes.push(this.range_.item(i))
    }
    goog.array.forEach(nodes, goog.dom.removeNode);
    this.collapse(!1)
  }
};
goog.dom.ControlRange.prototype.replaceContentsWithNode = function $goog$dom$ControlRange$$replaceContentsWithNode$(node) {
  var result = this.insertNode(node, !0);
  this.isCollapsed() || this.removeContents();
  return result
};
goog.dom.ControlRange.prototype.saveUsingDom = function $goog$dom$ControlRange$$saveUsingDom$() {
  return new goog.dom.DomSavedControlRange_(this)
};
goog.dom.ControlRange.prototype.collapse = function $goog$dom$ControlRange$$collapse$() {
  this.range_ = null;
  this.clearCachedValues_()
};
goog.dom.DomSavedControlRange_ = function $goog$dom$DomSavedControlRange_$(range) {
  this.elements_ = range.getElements()
};
goog.inherits(goog.dom.DomSavedControlRange_, goog.dom.SavedRange);
goog.dom.DomSavedControlRange_.prototype.restoreInternal = function $goog$dom$DomSavedControlRange_$$restoreInternal$() {
  for(var doc = this.elements_.length ? goog.dom.getOwnerDocument(this.elements_[0]) : document, controlRange = doc.body.createControlRange(), i = 0, len = this.elements_.length;i < len;i++) {
    controlRange.addElement(this.elements_[i])
  }
  return goog.dom.ControlRange.createFromBrowserRange(controlRange)
};
goog.dom.DomSavedControlRange_.prototype.disposeInternal = function $goog$dom$DomSavedControlRange_$$disposeInternal$() {
  goog.dom.DomSavedControlRange_.superClass_.disposeInternal.call(this);
  delete this.elements_
};
goog.dom.ControlRangeIterator = function $goog$dom$ControlRangeIterator$(range) {
  range && (this.elements_ = range.getSortedElements(), this.startNode_ = this.elements_.shift(), this.endNode_ = goog.array.peek(this.elements_) || this.startNode_);
  goog.dom.RangeIterator.call(this, this.startNode_, !1)
};
goog.inherits(goog.dom.ControlRangeIterator, goog.dom.RangeIterator);
goog.dom.ControlRangeIterator.prototype.startNode_ = null;
goog.dom.ControlRangeIterator.prototype.endNode_ = null;
goog.dom.ControlRangeIterator.prototype.elements_ = null;
goog.dom.ControlRangeIterator.prototype.getStartNode = function $goog$dom$ControlRangeIterator$$getStartNode$() {
  return this.startNode_
};
goog.dom.ControlRangeIterator.prototype.getEndNode = function $goog$dom$ControlRangeIterator$$getEndNode$() {
  return this.endNode_
};
goog.dom.ControlRangeIterator.prototype.isLast = function $goog$dom$ControlRangeIterator$$isLast$() {
  return!this.depth && !this.elements_.length
};
goog.dom.ControlRangeIterator.prototype.next = function $goog$dom$ControlRangeIterator$$next$() {
  if(this.isLast()) {
    throw goog.iter.StopIteration;
  }
  if(!this.depth) {
    var el = this.elements_.shift();
    this.setPosition(el, goog.dom.TagWalkType.START_TAG, goog.dom.TagWalkType.START_TAG);
    return el
  }
  return goog.dom.ControlRangeIterator.superClass_.next.call(this)
};
goog.dom.ControlRangeIterator.prototype.copyFrom = function $goog$dom$ControlRangeIterator$$copyFrom$(other) {
  this.elements_ = other.elements_;
  this.startNode_ = other.startNode_;
  this.endNode_ = other.endNode_;
  goog.dom.ControlRangeIterator.superClass_.copyFrom.call(this, other)
};
goog.dom.ControlRangeIterator.prototype.clone = function $goog$dom$ControlRangeIterator$$clone$() {
  var copy = new goog.dom.ControlRangeIterator(null);
  copy.copyFrom(this);
  return copy
};
goog.dom.MultiRange = function $goog$dom$MultiRange$() {
  this.browserRanges_ = [];
  this.ranges_ = [];
  this.container_ = this.sortedRanges_ = null
};
goog.inherits(goog.dom.MultiRange, goog.dom.AbstractMultiRange);
goog.dom.MultiRange.createFromBrowserSelection = function $goog$dom$MultiRange$createFromBrowserSelection$(selection) {
  for(var range = new goog.dom.MultiRange, i = 0, len = selection.rangeCount;i < len;i++) {
    range.browserRanges_.push(selection.getRangeAt(i))
  }
  return range
};
goog.dom.MultiRange.createFromBrowserRanges = function $goog$dom$MultiRange$createFromBrowserRanges$(browserRanges) {
  var range = new goog.dom.MultiRange;
  range.browserRanges_ = goog.array.clone(browserRanges);
  return range
};
goog.dom.MultiRange.createFromTextRanges = function $goog$dom$MultiRange$createFromTextRanges$(textRanges) {
  var range$$0 = new goog.dom.MultiRange;
  range$$0.ranges_ = textRanges;
  range$$0.browserRanges_ = goog.array.map(textRanges, function(range) {
    return range.getBrowserRangeObject()
  });
  return range$$0
};
goog.dom.MultiRange.prototype.logger_ = goog.debug.Logger.getLogger("goog.dom.MultiRange");
goog.dom.MultiRange.prototype.clearCachedValues_ = function $goog$dom$MultiRange$$clearCachedValues_$() {
  this.ranges_ = [];
  this.container_ = this.sortedRanges_ = null
};
goog.dom.MultiRange.prototype.clone = function $goog$dom$MultiRange$$clone$() {
  return goog.dom.MultiRange.createFromBrowserRanges(this.browserRanges_)
};
goog.dom.MultiRange.prototype.getType = function $goog$dom$MultiRange$$getType$() {
  return goog.dom.RangeType.MULTI
};
goog.dom.MultiRange.prototype.getBrowserRangeObject = function $goog$dom$MultiRange$$getBrowserRangeObject$() {
  1 < this.browserRanges_.length && this.logger_.warning("getBrowserRangeObject called on MultiRange with more than 1 range");
  return this.browserRanges_[0]
};
goog.dom.MultiRange.prototype.getTextRangeCount = function $goog$dom$MultiRange$$getTextRangeCount$() {
  return this.browserRanges_.length
};
goog.dom.MultiRange.prototype.getTextRange = function $goog$dom$MultiRange$$getTextRange$(i) {
  this.ranges_[i] || (this.ranges_[i] = goog.dom.TextRange.createFromBrowserRange(this.browserRanges_[i]));
  return this.ranges_[i]
};
goog.dom.MultiRange.prototype.getContainer = function $goog$dom$MultiRange$$getContainer$() {
  if(!this.container_) {
    for(var nodes = [], i = 0, len = this.getTextRangeCount();i < len;i++) {
      nodes.push(this.getTextRange(i).getContainer())
    }
    this.container_ = goog.dom.findCommonAncestor.apply(null, nodes)
  }
  return this.container_
};
goog.dom.MultiRange.prototype.getSortedRanges = function $goog$dom$MultiRange$$getSortedRanges$() {
  this.sortedRanges_ || (this.sortedRanges_ = this.getTextRanges(), this.sortedRanges_.sort(function(a, b) {
    var aStartNode = a.getStartNode(), aStartOffset = a.getStartOffset(), bStartNode = b.getStartNode(), bStartOffset = b.getStartOffset();
    return aStartNode == bStartNode && aStartOffset == bStartOffset ? 0 : goog.dom.Range.isReversed(aStartNode, aStartOffset, bStartNode, bStartOffset) ? 1 : -1
  }));
  return this.sortedRanges_
};
goog.dom.MultiRange.prototype.getStartNode = function $goog$dom$MultiRange$$getStartNode$() {
  return this.getSortedRanges()[0].getStartNode()
};
goog.dom.MultiRange.prototype.getStartOffset = function $goog$dom$MultiRange$$getStartOffset$() {
  return this.getSortedRanges()[0].getStartOffset()
};
goog.dom.MultiRange.prototype.getEndNode = function $goog$dom$MultiRange$$getEndNode$() {
  return goog.array.peek(this.getSortedRanges()).getEndNode()
};
goog.dom.MultiRange.prototype.getEndOffset = function $goog$dom$MultiRange$$getEndOffset$() {
  return goog.array.peek(this.getSortedRanges()).getEndOffset()
};
goog.dom.MultiRange.prototype.isRangeInDocument = function $goog$dom$MultiRange$$isRangeInDocument$() {
  return goog.array.every(this.getTextRanges(), function(range) {
    return range.isRangeInDocument()
  })
};
goog.dom.MultiRange.prototype.isCollapsed = function $goog$dom$MultiRange$$isCollapsed$() {
  return 0 == this.browserRanges_.length || 1 == this.browserRanges_.length && this.getTextRange(0).isCollapsed()
};
goog.dom.MultiRange.prototype.getText = function $goog$dom$MultiRange$$getText$() {
  return goog.array.map(this.getTextRanges(), function(range) {
    return range.getText()
  }).join("")
};
goog.dom.MultiRange.prototype.__iterator__ = function $goog$dom$MultiRange$$__iterator__$() {
  return new goog.dom.MultiRangeIterator(this)
};
goog.dom.MultiRange.prototype.select = function $goog$dom$MultiRange$$select$() {
  var selection = goog.dom.AbstractRange.getBrowserSelectionForWindow(this.getWindow());
  selection.removeAllRanges();
  for(var i = 0, len = this.getTextRangeCount();i < len;i++) {
    selection.addRange(this.getTextRange(i).getBrowserRangeObject())
  }
};
goog.dom.MultiRange.prototype.removeContents = function $goog$dom$MultiRange$$removeContents$() {
  goog.array.forEach(this.getTextRanges(), function(range) {
    range.removeContents()
  })
};
goog.dom.MultiRange.prototype.saveUsingDom = function $goog$dom$MultiRange$$saveUsingDom$() {
  return new goog.dom.DomSavedMultiRange_(this)
};
goog.dom.MultiRange.prototype.collapse = function $goog$dom$MultiRange$$collapse$(toAnchor) {
  if(!this.isCollapsed()) {
    var range = toAnchor ? this.getTextRange(0) : this.getTextRange(this.getTextRangeCount() - 1);
    this.clearCachedValues_();
    range.collapse(toAnchor);
    this.ranges_ = [range];
    this.sortedRanges_ = [range];
    this.browserRanges_ = [range.getBrowserRangeObject()]
  }
};
goog.dom.DomSavedMultiRange_ = function $goog$dom$DomSavedMultiRange_$(range$$0) {
  this.savedRanges_ = goog.array.map(range$$0.getTextRanges(), function(range) {
    return range.saveUsingDom()
  })
};
goog.inherits(goog.dom.DomSavedMultiRange_, goog.dom.SavedRange);
goog.dom.DomSavedMultiRange_.prototype.restoreInternal = function $goog$dom$DomSavedMultiRange_$$restoreInternal$() {
  var ranges = goog.array.map(this.savedRanges_, function(savedRange) {
    return savedRange.restore()
  });
  return goog.dom.MultiRange.createFromTextRanges(ranges)
};
goog.dom.DomSavedMultiRange_.prototype.disposeInternal = function $goog$dom$DomSavedMultiRange_$$disposeInternal$() {
  goog.dom.DomSavedMultiRange_.superClass_.disposeInternal.call(this);
  goog.array.forEach(this.savedRanges_, function(savedRange) {
    savedRange.dispose()
  });
  delete this.savedRanges_
};
goog.dom.MultiRangeIterator = function $goog$dom$MultiRangeIterator$(range) {
  range && (this.iterators_ = goog.array.map(range.getSortedRanges(), function(r) {
    return goog.iter.toIterator(r)
  }));
  goog.dom.RangeIterator.call(this, range ? this.getStartNode() : null, !1)
};
goog.inherits(goog.dom.MultiRangeIterator, goog.dom.RangeIterator);
goog.dom.MultiRangeIterator.prototype.iterators_ = null;
goog.dom.MultiRangeIterator.prototype.currentIdx_ = 0;
goog.dom.MultiRangeIterator.prototype.getStartNode = function $goog$dom$MultiRangeIterator$$getStartNode$() {
  return this.iterators_[0].getStartNode()
};
goog.dom.MultiRangeIterator.prototype.getEndNode = function $goog$dom$MultiRangeIterator$$getEndNode$() {
  return goog.array.peek(this.iterators_).getEndNode()
};
goog.dom.MultiRangeIterator.prototype.isLast = function $goog$dom$MultiRangeIterator$$isLast$() {
  return this.iterators_[this.currentIdx_].isLast()
};
goog.dom.MultiRangeIterator.prototype.next = function $goog$dom$MultiRangeIterator$$next$() {
  try {
    var it = this.iterators_[this.currentIdx_], next = it.next();
    this.setPosition(it.node, it.tagType, it.depth);
    return next
  }catch(ex) {
    if(ex !== goog.iter.StopIteration || this.iterators_.length - 1 == this.currentIdx_) {
      throw ex;
    }
    this.currentIdx_++;
    return this.next()
  }
};
goog.dom.MultiRangeIterator.prototype.copyFrom = function $goog$dom$MultiRangeIterator$$copyFrom$(other) {
  this.iterators_ = goog.array.clone(other.iterators_);
  goog.dom.MultiRangeIterator.superClass_.copyFrom.call(this, other)
};
goog.dom.MultiRangeIterator.prototype.clone = function $goog$dom$MultiRangeIterator$$clone$() {
  var copy = new goog.dom.MultiRangeIterator(null);
  copy.copyFrom(this);
  return copy
};
goog.dom.Range = {};
goog.dom.Range.createFromWindow = function $goog$dom$Range$createFromWindow$(opt_win) {
  var sel = goog.dom.AbstractRange.getBrowserSelectionForWindow(opt_win || window);
  return sel && goog.dom.Range.createFromBrowserSelection(sel)
};
goog.dom.Range.createFromBrowserSelection = function $goog$dom$Range$createFromBrowserSelection$(selection) {
  var range, isReversed = !1;
  if(selection.createRange) {
    try {
      range = selection.createRange()
    }catch(e) {
      return null
    }
  }else {
    if(selection.rangeCount) {
      if(1 < selection.rangeCount) {
        return goog.dom.MultiRange.createFromBrowserSelection(selection)
      }
      range = selection.getRangeAt(0);
      isReversed = goog.dom.Range.isReversed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset)
    }else {
      return null
    }
  }
  return goog.dom.Range.createFromBrowserRange(range, isReversed)
};
goog.dom.Range.createFromBrowserRange = function $goog$dom$Range$createFromBrowserRange$(range, opt_isReversed) {
  return goog.dom.AbstractRange.isNativeControlRange(range) ? goog.dom.ControlRange.createFromBrowserRange(range) : goog.dom.TextRange.createFromBrowserRange(range, opt_isReversed)
};
goog.dom.Range.createFromNodeContents = function $goog$dom$Range$createFromNodeContents$(node, opt_isReversed) {
  return goog.dom.TextRange.createFromNodeContents(node, opt_isReversed)
};
goog.dom.Range.createCaret = function $goog$dom$Range$createCaret$(node, offset) {
  return goog.dom.TextRange.createFromNodes(node, offset, node, offset)
};
goog.dom.Range.createFromNodes = function $goog$dom$Range$createFromNodes$(startNode, startOffset, endNode, endOffset) {
  return goog.dom.TextRange.createFromNodes(startNode, startOffset, endNode, endOffset)
};
goog.dom.Range.clearSelection = function $goog$dom$Range$clearSelection$(opt_win) {
  var sel = goog.dom.AbstractRange.getBrowserSelectionForWindow(opt_win || window);
  if(sel) {
    if(sel.empty) {
      try {
        sel.empty()
      }catch(e) {
      }
    }else {
      try {
        sel.removeAllRanges()
      }catch(e$$0) {
      }
    }
  }
};
goog.dom.Range.hasSelection = function $goog$dom$Range$hasSelection$(opt_win) {
  var sel = goog.dom.AbstractRange.getBrowserSelectionForWindow(opt_win || window);
  return!!sel && (goog.userAgent.IE ? "None" != sel.type : !!sel.rangeCount)
};
goog.dom.Range.isReversed = function $goog$dom$Range$isReversed$(anchorNode, anchorOffset, focusNode, focusOffset) {
  if(anchorNode == focusNode) {
    return focusOffset < anchorOffset
  }
  var child;
  if(anchorNode.nodeType == goog.dom.NodeType.ELEMENT && anchorOffset) {
    if(child = anchorNode.childNodes[anchorOffset]) {
      anchorNode = child, anchorOffset = 0
    }else {
      if(goog.dom.contains(anchorNode, focusNode)) {
        return!0
      }
    }
  }
  if(focusNode.nodeType == goog.dom.NodeType.ELEMENT && focusOffset) {
    if(child = focusNode.childNodes[focusOffset]) {
      focusNode = child, focusOffset = 0
    }else {
      if(goog.dom.contains(focusNode, anchorNode)) {
        return!1
      }
    }
  }
  return 0 < (goog.dom.compareNodeOrder(anchorNode, focusNode) || anchorOffset - focusOffset)
};
goog.Timer = function $goog$Timer$(opt_interval, opt_timerObject) {
  goog.events.EventTarget.call(this);
  this.interval_ = opt_interval || 1;
  this.timerObject_ = opt_timerObject || goog.Timer.defaultTimerObject;
  this.boundTick_ = goog.bind(this.tick_, this);
  this.last_ = goog.now()
};
goog.inherits(goog.Timer, goog.events.EventTarget);
goog.Timer.MAX_TIMEOUT_ = 2147483647;
goog.Timer.prototype.enabled = !1;
goog.Timer.defaultTimerObject = goog.global.window;
goog.Timer.intervalScale = 0.8;
goog.Timer.prototype.timer_ = null;
goog.Timer.prototype.tick_ = function $goog$Timer$$tick_$() {
  if(this.enabled) {
    var elapsed = goog.now() - this.last_;
    0 < elapsed && elapsed < this.interval_ * goog.Timer.intervalScale ? this.timer_ = this.timerObject_.setTimeout(this.boundTick_, this.interval_ - elapsed) : (this.dispatchTick(), this.enabled && (this.timer_ = this.timerObject_.setTimeout(this.boundTick_, this.interval_), this.last_ = goog.now()))
  }
};
goog.Timer.prototype.dispatchTick = function $goog$Timer$$dispatchTick$() {
  this.dispatchEvent(goog.Timer.TICK)
};
goog.Timer.prototype.start = function $goog$Timer$$start$() {
  this.enabled = !0;
  this.timer_ || (this.timer_ = this.timerObject_.setTimeout(this.boundTick_, this.interval_), this.last_ = goog.now())
};
goog.Timer.prototype.stop = function $goog$Timer$$stop$() {
  this.enabled = !1;
  this.timer_ && (this.timerObject_.clearTimeout(this.timer_), this.timer_ = null)
};
goog.Timer.prototype.disposeInternal = function $goog$Timer$$disposeInternal$() {
  goog.Timer.superClass_.disposeInternal.call(this);
  this.stop();
  delete this.timerObject_
};
goog.Timer.TICK = "tick";
goog.Timer.callOnce = function $goog$Timer$callOnce$(listener, opt_delay, opt_handler) {
  if(goog.isFunction(listener)) {
    opt_handler && (listener = goog.bind(listener, opt_handler))
  }else {
    if(listener && "function" == typeof listener.handleEvent) {
      listener = goog.bind(listener.handleEvent, listener)
    }else {
      throw Error("Invalid listener argument");
    }
  }
  return opt_delay > goog.Timer.MAX_TIMEOUT_ ? -1 : goog.Timer.defaultTimerObject.setTimeout(listener, opt_delay || 0)
};
goog.Timer.clear = function $goog$Timer$clear$(timerId) {
  goog.Timer.defaultTimerObject.clearTimeout(timerId)
};
goog.ime.plugin.SuggestionItem = function $goog$ime$plugin$SuggestionItem$() {
};
goog.ime.plugin.Suggestion = function $goog$ime$plugin$Suggestion$(inputText, suggestions) {
  this.defaultSuggestion_ = this.inputText_ = inputText;
  this.suggestions_ = [];
  this.setSuggestions(suggestions)
};
goog.ime.plugin.Suggestion.prototype.getInput = function $goog$ime$plugin$Suggestion$$getInput$() {
  return this.inputText_
};
goog.ime.plugin.Suggestion.prototype.getDefault = function $goog$ime$plugin$Suggestion$$getDefault$() {
  return this.defaultSuggestion_
};
goog.ime.plugin.Suggestion.prototype.setDefault = function $goog$ime$plugin$Suggestion$$setDefault$(suggestion) {
  this.getText(suggestion) != this.inputText_ && (this.defaultSuggestion_ = suggestion)
};
goog.ime.plugin.Suggestion.prototype.setSuggestions = function $goog$ime$plugin$Suggestion$$setSuggestions$(suggestions) {
  suggestions && 0 < suggestions.length && (this.suggestions_ = suggestions)
};
goog.ime.plugin.Suggestion.prototype.getSuggestions = function $goog$ime$plugin$Suggestion$$getSuggestions$() {
  return this.suggestions_
};
goog.ime.plugin.Suggestion.prototype.getSuggestionCount = function $goog$ime$plugin$Suggestion$$getSuggestionCount$() {
  return this.suggestions_.length
};
goog.ime.plugin.Suggestion.prototype.getText = function $goog$ime$plugin$Suggestion$$getText$(suggestionItem) {
  return goog.isString(suggestionItem) ? suggestionItem : suggestionItem.getText()
};
goog.ime.plugin.Suggestion.prototype.getDisplayContent = function $goog$ime$plugin$Suggestion$$getDisplayContent$(suggestionItem, index) {
  return goog.isString(suggestionItem) ? suggestionItem : suggestionItem.getDisplayContent(index)
};
goog.ime.plugin.Suggestion.prototype.forEachSuggestion = function $goog$ime$plugin$Suggestion$$forEachSuggestion$(fn) {
  goog.array.forEach(this.suggestions_, fn)
};
goog.ime.plugin.lang.TranslitSuggestion = function $goog$ime$plugin$lang$TranslitSuggestion$(inputText, suggestions) {
  this.acceptanceMap_ = {};
  this.correctionMap_ = {};
  this.segments_ = [];
  goog.ime.plugin.Suggestion.call(this, inputText, suggestions)
};
goog.inherits(goog.ime.plugin.lang.TranslitSuggestion, goog.ime.plugin.Suggestion);
goog.ime.plugin.lang.TranslitSuggestion.prototype.logger = goog.debug.Logger.getLogger("goog.ime.plugin.lang.TranslitSuggestion");
goog.ime.plugin.lang.TranslitSuggestion.prototype.setDefault = function $goog$ime$plugin$lang$TranslitSuggestion$$setDefault$(suggestion) {
  this.updateCounts_(this.getDefault(), -1, 0);
  goog.ime.plugin.lang.TranslitSuggestion.superClass_.setDefault.call(this, suggestion);
  this.updateCounts_(this.getDefault(), 0, 1)
};
goog.ime.plugin.lang.TranslitSuggestion.prototype.acceptDefault = function $goog$ime$plugin$lang$TranslitSuggestion$$acceptDefault$() {
  var defaultSuggestion = this.getDefault();
  this.updateCounts_(defaultSuggestion, 1, 0);
  return this.getText(defaultSuggestion)
};
goog.ime.plugin.lang.TranslitSuggestion.prototype.getSuggestionCount = function $goog$ime$plugin$lang$TranslitSuggestion$$getSuggestionCount$() {
  return goog.array.reduce(this.segments_, function(count, segment) {
    return Math.max(count, segment.getSuggestionCount())
  }, goog.ime.plugin.lang.TranslitSuggestion.superClass_.getSuggestionCount.call(this))
};
goog.ime.plugin.lang.TranslitSuggestion.prototype.setSuggestions = function $goog$ime$plugin$lang$TranslitSuggestion$$setSuggestions$(suggestions) {
  goog.ime.plugin.lang.TranslitSuggestion.superClass_.setSuggestions.call(this, suggestions);
  suggestions && 0 < suggestions.length && goog.ime.plugin.lang.TranslitSuggestion.superClass_.setDefault.call(this, suggestions[0])
};
goog.ime.plugin.lang.TranslitSuggestion.prototype.updateCounts_ = function $goog$ime$plugin$lang$TranslitSuggestion$$updateCounts_$(suggestion, acceptanceCount, correctionCount) {
  var textSuggestion = this.getText(suggestion);
  textSuggestion != this.getInput() && (void 0 == this.acceptanceMap_[textSuggestion] ? (this.acceptanceMap_[textSuggestion] = acceptanceCount, this.correctionMap_[textSuggestion] = correctionCount) : (this.acceptanceMap_[textSuggestion] += acceptanceCount, this.correctionMap_[textSuggestion] += correctionCount), 0 > this.acceptanceMap_[textSuggestion] && (this.acceptanceMap_[textSuggestion] = 0))
};
goog.ime.plugin.lang.TranslitSuggestion.prototype.clearCounts = function $goog$ime$plugin$lang$TranslitSuggestion$$clearCounts$() {
  this.acceptanceMap_ = {};
  this.correctionMap_ = {}
};
goog.ime.plugin.lang.TranslitSuggestion.prototype.getCountString = function $goog$ime$plugin$lang$TranslitSuggestion$$getCountString$() {
  var countString = "", countString = countString + this.getInput();
  goog.array.forEach(this.getSuggestions(), function(suggestion) {
    void 0 != this.acceptanceMap_[suggestion] && (countString += ":" + suggestion + "-" + this.correctionMap_[suggestion] + "-" + this.acceptanceMap_[suggestion] + ":")
  }, this);
  this.logger.info("count string : " + countString);
  return countString
};
goog.ime.plugin.lang.TranslitSuggestion.prototype.getSegments = function $goog$ime$plugin$lang$TranslitSuggestion$$getSegments$() {
  return this.segments_
};
goog.ime.plugin.lang.TranslitSuggestion.prototype.addSegmentSuggestion = function $goog$ime$plugin$lang$TranslitSuggestion$$addSegmentSuggestion$(segmentSuggestion) {
  this.segments_.push(segmentSuggestion)
};
goog.ime.plugin.lang.CommitQueue = function $goog$ime$plugin$lang$CommitQueue$() {
  this.body_ = [];
  this.tail_ = this.head_ = 0
};
goog.ime.plugin.lang.CommitQueue.CommitRequest = function $goog$ime$plugin$lang$CommitQueue$CommitRequest$(request, opt_commit, opt_inputtoolcode) {
  this.request = request;
  this.commit = opt_commit || "";
  this.request_time = (new Date).getTime();
  this.inputtoolcode = opt_inputtoolcode || ""
};
goog.ime.plugin.lang.CommitQueue.prototype.isEmpty = function $goog$ime$plugin$lang$CommitQueue$$isEmpty$() {
  return this.head_ == this.tail_
};
goog.ime.plugin.lang.CommitQueue.prototype.push = function $goog$ime$plugin$lang$CommitQueue$$push$(request, opt_commit, opt_inputtoolcode) {
  var requestItem = new goog.ime.plugin.lang.CommitQueue.CommitRequest(request, opt_commit, opt_inputtoolcode);
  this.body_[this.tail_++] = requestItem
};
goog.ime.plugin.lang.CommitQueue.prototype.peek_ = function $goog$ime$plugin$lang$CommitQueue$$peek_$() {
  return!this.isEmpty() ? this.body_[this.head_] : null
};
goog.ime.plugin.lang.CommitQueue.prototype.removeHead = function $goog$ime$plugin$lang$CommitQueue$$removeHead$() {
  this.isEmpty() || delete this.body_[this.head_++]
};
goog.ime.plugin.lang.CommitQueue.prototype.clear = function $goog$ime$plugin$lang$CommitQueue$$clear$() {
  for(var i = this.head_;i < this.tail_;++i) {
    delete this.body_[i]
  }
  this.tail_ = this.head_ = 0
};
goog.ime.plugin.lang.CommitQueue.MAX_SUSPENDED_TIME_IN_MILLISECOND = 1E4;
goog.ime.plugin.lang.CommitQueue.prototype.process = function $goog$ime$plugin$lang$CommitQueue$$process$(local_find) {
  for(var response = "";!this.isEmpty();) {
    var request = this.peek_(), commit_text = request.commit;
    if(!commit_text) {
      var suggestion = local_find(request.request, request.inputtoolcode), commit_text = "";
      if(suggestion) {
        var transforms = suggestion.getSuggestions();
        transforms && transforms.length && (commit_text = transforms[0].getText())
      }else {
        var current = new Date;
        if(current.getTime() - request.request_time < goog.ime.plugin.lang.CommitQueue.MAX_SUSPENDED_TIME_IN_MILLISECOND) {
          break
        }
      }
    }
    response += commit_text;
    this.removeHead()
  }
  return response
};
goog.ime.plugin.lang.InputMethodFeatureConfig = {};
goog.ime.plugin.lang.InputMethodFeatureConfig.inputMethodWithPopupEditor_ = [goog.ime.lang.InputToolCode.INPUTMETHOD_PINYIN_CHINESE_SIMPLIFIED, goog.ime.lang.InputToolCode.INPUTMETHOD_PINYIN_CHINESE_TRADITIONAL, goog.ime.lang.InputToolCode.INPUTMETHOD_WUBI_CHINESE_SIMPLIFIED, goog.ime.lang.InputToolCode.INPUTMETHOD_ZHUYIN_CHINESE_TRADITIONAL, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_RUSSIAN, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_JAPANESE, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_VIETNAMESE];
goog.ime.plugin.lang.InputMethodFeatureConfig.inputMethodWithTransform_ = [goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_AMHARIC, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_ARABIC, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_GREEK, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HEBREW, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HIRAGANA, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_KANNADA, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_MALAYALAM, 
goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_ORIYA, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_PERSIAN, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_SANSKRIT, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_SERBIAN, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_SINHALESE, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_TAMIL, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_TELUGU, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_TIGRINYA, 
goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_URDU, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_BENGALI, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_GUJARATI, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HINDI, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_MARATHI, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_NEPALI, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_PUNJABI];
goog.ime.plugin.lang.InputMethodFeatureConfig.Feature = {DANDA_MARK:"danda_mark", NATIVE_NUMBER:"native_number", ENTER_EVENT_TO_BROWSER:"enter_event_to_browser", AUTO_SELECTION:"auto_selection", INSTANCE_DISPLAY:"instance_display", PRECOMMIT:"precommit", PRE_STATIC_MAPPING:"pre_static_mapping"};
goog.ime.plugin.lang.InputMethodFeatureConfig.inputMethodFeatures = {danda_mark:[goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_BENGALI, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_GUJARATI, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HINDI, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_MARATHI, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_NEPALI, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_PUNJABI], native_number:[goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_ARABIC, 
goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_BENGALI, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_PERSIAN, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_URDU], enter_event_to_browser:[], auto_selection:[goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_AMHARIC, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_ARABIC, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_GREEK, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HEBREW, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HIRAGANA, 
goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_KANNADA, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_MALAYALAM, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_ORIYA, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_PERSIAN, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_RUSSIAN, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_SANSKRIT, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_SERBIAN, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_SINHALESE, 
goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_TAMIL, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_TELUGU, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_TIGRINYA, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_URDU, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_BENGALI, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_GUJARATI, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HINDI, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_MARATHI, 
goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_NEPALI, goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_PUNJABI], instance_display:[], precommit:[goog.ime.lang.InputToolCode.INPUTMETHOD_WUBI_CHINESE_SIMPLIFIED], pre_static_mapping:[goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_ARABIC]};
goog.ime.plugin.lang.InputMethodFeatureConfig.getFeatures = function $goog$ime$plugin$lang$InputMethodFeatureConfig$getFeatures$(inputTool) {
  var features = [];
  goog.object.forEach(goog.ime.plugin.lang.InputMethodFeatureConfig.inputMethodFeatures, function(value, key) {
    goog.array.contains(value, inputTool.code) && goog.array.insert(features, key)
  });
  return features
};
goog.ime.plugin.lang.InputMethodFeatureConfig.enablePopupEditor = function $goog$ime$plugin$lang$InputMethodFeatureConfig$enablePopupEditor$(inputTools) {
  var config = goog.ime.plugin.lang.InputMethodFeatureConfig;
  goog.array.extend(config.inputMethodWithPopupEditor_, inputTools);
  goog.array.forEach(inputTools, function(inputTool) {
    goog.array.remove(config.inputMethodWithTransform_, inputTool)
  })
};
goog.ime.plugin.lang.InputMethodFeatureConfig.disablePopupEditor = function $goog$ime$plugin$lang$InputMethodFeatureConfig$disablePopupEditor$(inputTools) {
  var config = goog.ime.plugin.lang.InputMethodFeatureConfig;
  goog.array.extend(config.inputMethodWithTransform_, inputTools);
  goog.array.forEach(inputTools, function(inputTool) {
    goog.array.remove(config.inputMethodWithPopupEditor_, inputTool)
  })
};
goog.ime.plugin.lang.InputMethodFeatureConfig.getInputMethodsWithPopupEditor = function $goog$ime$plugin$lang$InputMethodFeatureConfig$getInputMethodsWithPopupEditor$() {
  return goog.ime.plugin.lang.InputMethodFeatureConfig.inputMethodWithPopupEditor_
};
goog.ime.plugin.lang.InputMethodFeatureConfig.getInputMethodsWithTransform = function $goog$ime$plugin$lang$InputMethodFeatureConfig$getInputMethodsWithTransform$() {
  return goog.ime.plugin.lang.InputMethodFeatureConfig.inputMethodWithTransform_
};
goog.ime.plugin.lang.InputMethodFeatureConfig.enableFeaturesForInputTools = function $goog$ime$plugin$lang$InputMethodFeatureConfig$enableFeaturesForInputTools$(features, inputTools) {
  var configFeatures = goog.ime.plugin.lang.InputMethodFeatureConfig.inputMethodFeatures;
  goog.array.forEach(features, function(feature) {
    configFeatures[feature] && (goog.array.extend(configFeatures[feature], inputTools), goog.array.removeDuplicates(configFeatures[feature]))
  })
};
goog.ime.plugin.lang.InputMethodFeatureConfig.disableFeaturesForInputTools = function $goog$ime$plugin$lang$InputMethodFeatureConfig$disableFeaturesForInputTools$(features, inputTools) {
  var configFeatures = goog.ime.plugin.lang.InputMethodFeatureConfig.inputMethodFeatures;
  goog.array.forEach(features, function(feature) {
    configFeatures[feature] && goog.array.forEach(inputTools, function(inputTool) {
      goog.array.remove(configFeatures[feature], inputTool)
    })
  })
};
goog.ime.dom.TransformationEvent = {};
goog.ime.dom.TransformationEventType = {SHOW_CORRECTIONS:"ss", SHOW_COMPLETIONS:"sc", REPLACE_CONTENTS:"rc", AFTER_REPLACE_CONTENTS:"arc"};
goog.positioning.AnchoredViewportPosition = function $goog$positioning$AnchoredViewportPosition$(anchorElement, corner, opt_adjust) {
  goog.positioning.AnchoredPosition.call(this, anchorElement, corner);
  this.lastResortOverflow_ = opt_adjust ? goog.positioning.Overflow.ADJUST_X | goog.positioning.Overflow.ADJUST_Y : goog.positioning.Overflow.IGNORE
};
goog.inherits(goog.positioning.AnchoredViewportPosition, goog.positioning.AnchoredPosition);
goog.positioning.AnchoredViewportPosition.prototype.getLastResortOverflow = function $goog$positioning$AnchoredViewportPosition$$getLastResortOverflow$() {
  return this.lastResortOverflow_
};
goog.positioning.AnchoredViewportPosition.prototype.setLastResortOverflow = function $goog$positioning$AnchoredViewportPosition$$setLastResortOverflow$(lastResortOverflow) {
  this.lastResortOverflow_ = lastResortOverflow
};
goog.positioning.AnchoredViewportPosition.prototype.reposition = function $goog$positioning$AnchoredViewportPosition$$reposition$(movableElement, movableCorner, opt_margin, opt_preferredSize) {
  var status = goog.positioning.positionAtAnchor(this.element, this.corner, movableElement, movableCorner, null, opt_margin, goog.positioning.Overflow.FAIL_X | goog.positioning.Overflow.FAIL_Y, opt_preferredSize);
  if(status & goog.positioning.OverflowStatus.FAILED) {
    var cornerFallback = this.correctCorner_(status, this.corner), movableCornerFallback = this.correctCorner_(status, movableCorner), status = goog.positioning.positionAtAnchor(this.element, cornerFallback, movableElement, movableCornerFallback, null, opt_margin, goog.positioning.Overflow.FAIL_X | goog.positioning.Overflow.FAIL_Y, opt_preferredSize);
    status & goog.positioning.OverflowStatus.FAILED && (cornerFallback = this.correctCorner_(status, cornerFallback), movableCornerFallback = this.correctCorner_(status, movableCornerFallback), goog.positioning.positionAtAnchor(this.element, cornerFallback, movableElement, movableCornerFallback, null, opt_margin, this.getLastResortOverflow(), opt_preferredSize))
  }
};
goog.positioning.AnchoredViewportPosition.prototype.correctCorner_ = function $goog$positioning$AnchoredViewportPosition$$correctCorner_$(status, corner) {
  status & goog.positioning.OverflowStatus.FAILED_HORIZONTAL && (corner = goog.positioning.flipCornerHorizontal(corner));
  status & goog.positioning.OverflowStatus.FAILED_VERTICAL && (corner = goog.positioning.flipCornerVertical(corner));
  return corner
};
goog.positioning.MenuAnchoredPosition = function $goog$positioning$MenuAnchoredPosition$(anchorElement, corner, opt_adjust, opt_resize) {
  goog.positioning.AnchoredViewportPosition.call(this, anchorElement, corner, opt_adjust || opt_resize);
  if(opt_adjust || opt_resize) {
    var overflowX = goog.positioning.Overflow.ADJUST_X_EXCEPT_OFFSCREEN, overflowY = opt_resize ? goog.positioning.Overflow.RESIZE_HEIGHT : goog.positioning.Overflow.ADJUST_Y_EXCEPT_OFFSCREEN;
    this.setLastResortOverflow(overflowX | overflowY)
  }
};
goog.inherits(goog.positioning.MenuAnchoredPosition, goog.positioning.AnchoredViewportPosition);
goog.positioning.ClientPosition = function $goog$positioning$ClientPosition$(arg1, opt_arg2) {
  this.coordinate = arg1 instanceof goog.math.Coordinate ? arg1 : new goog.math.Coordinate(arg1, opt_arg2)
};
goog.inherits(goog.positioning.ClientPosition, goog.positioning.AbstractPosition);
goog.positioning.ClientPosition.prototype.reposition = function $goog$positioning$ClientPosition$$reposition$(element, popupCorner, opt_margin, opt_preferredSize) {
  var viewportElt = goog.style.getClientViewportElement(element), clientPos = new goog.math.Coordinate(this.coordinate.x + viewportElt.scrollLeft, this.coordinate.y + viewportElt.scrollTop);
  goog.positioning.positionAtAnchor(viewportElt, goog.positioning.Corner.TOP_LEFT, element, popupCorner, clientPos, opt_margin, null, opt_preferredSize)
};
goog.positioning.ViewportClientPosition = function $goog$positioning$ViewportClientPosition$(arg1, opt_arg2) {
  goog.positioning.ClientPosition.call(this, arg1, opt_arg2)
};
goog.inherits(goog.positioning.ViewportClientPosition, goog.positioning.ClientPosition);
goog.positioning.ViewportClientPosition.prototype.lastResortOverflow_ = 0;
goog.positioning.ViewportClientPosition.prototype.setLastResortOverflow = function $goog$positioning$ViewportClientPosition$$setLastResortOverflow$(overflow) {
  this.lastResortOverflow_ = overflow
};
goog.positioning.ViewportClientPosition.prototype.reposition = function $goog$positioning$ViewportClientPosition$$reposition$(element, popupCorner, opt_margin, opt_preferredSize) {
  var viewportElt = goog.style.getClientViewportElement(element), viewport = goog.style.getVisibleRectForElement(viewportElt), scrollEl = goog.dom.getDomHelper(element).getDocumentScrollElement(), clientPos = new goog.math.Coordinate(this.coordinate.x + scrollEl.scrollLeft, this.coordinate.y + scrollEl.scrollTop), failXY = goog.positioning.Overflow.FAIL_X | goog.positioning.Overflow.FAIL_Y, corner = popupCorner, status = goog.positioning.positionAtCoordinate(clientPos, element, corner, opt_margin, 
  viewport, failXY, opt_preferredSize);
  if(0 != (status & goog.positioning.OverflowStatus.FAILED)) {
    if(status & goog.positioning.OverflowStatus.FAILED_LEFT || status & goog.positioning.OverflowStatus.FAILED_RIGHT) {
      corner = goog.positioning.flipCornerHorizontal(corner)
    }
    if(status & goog.positioning.OverflowStatus.FAILED_TOP || status & goog.positioning.OverflowStatus.FAILED_BOTTOM) {
      corner = goog.positioning.flipCornerVertical(corner)
    }
    status = goog.positioning.positionAtCoordinate(clientPos, element, corner, opt_margin, viewport, failXY, opt_preferredSize);
    0 != (status & goog.positioning.OverflowStatus.FAILED) && goog.positioning.positionAtCoordinate(clientPos, element, popupCorner, opt_margin, viewport, this.lastResortOverflow_, opt_preferredSize)
  }
};
goog.dom.a11y = {};
goog.dom.a11y.State = {ACTIVEDESCENDANT:"activedescendant", ATOMIC:"atomic", AUTOCOMPLETE:"autocomplete", BUSY:"busy", CHECKED:"checked", CONTROLS:"controls", DESCRIBEDBY:"describedby", DISABLED:"disabled", DROPEFFECT:"dropeffect", EXPANDED:"expanded", FLOWTO:"flowto", GRABBED:"grabbed", HASPOPUP:"haspopup", HIDDEN:"hidden", INVALID:"invalid", LABEL:"label", LABELLEDBY:"labelledby", LEVEL:"level", LIVE:"live", MULTILINE:"multiline", MULTISELECTABLE:"multiselectable", ORIENTATION:"orientation", OWNS:"owns", 
POSINSET:"posinset", PRESSED:"pressed", READONLY:"readonly", RELEVANT:"relevant", REQUIRED:"required", SELECTED:"selected", SETSIZE:"setsize", SORT:"sort", VALUEMAX:"valuemax", VALUEMIN:"valuemin", VALUENOW:"valuenow", VALUETEXT:"valuetext"};
goog.dom.a11y.Role = {ALERT:"alert", ALERTDIALOG:"alertdialog", APPLICATION:"application", ARTICLE:"article", BANNER:"banner", BUTTON:"button", CHECKBOX:"checkbox", COLUMNHEADER:"columnheader", COMBOBOX:"combobox", COMPLEMENTARY:"complementary", DIALOG:"dialog", DIRECTORY:"directory", DOCUMENT:"document", FORM:"form", GRID:"grid", GRIDCELL:"gridcell", GROUP:"group", HEADING:"heading", IMG:"img", LINK:"link", LIST:"list", LISTBOX:"listbox", LISTITEM:"listitem", LOG:"log", MAIN:"main", MARQUEE:"marquee", 
MATH:"math", MENU:"menu", MENUBAR:"menubar", MENU_ITEM:"menuitem", MENU_ITEM_CHECKBOX:"menuitemcheckbox", MENU_ITEM_RADIO:"menuitemradio", NAVIGATION:"navigation", NOTE:"note", OPTION:"option", PRESENTATION:"presentation", PROGRESSBAR:"progressbar", RADIO:"radio", RADIOGROUP:"radiogroup", REGION:"region", ROW:"row", ROWGROUP:"rowgroup", ROWHEADER:"rowheader", SCROLLBAR:"scrollbar", SEARCH:"search", SEPARATOR:"separator", SLIDER:"slider", SPINBUTTON:"spinbutton", STATUS:"status", TAB:"tab", TAB_LIST:"tablist", 
TAB_PANEL:"tabpanel", TEXTBOX:"textbox", TIMER:"timer", TOOLBAR:"toolbar", TOOLTIP:"tooltip", TREE:"tree", TREEGRID:"treegrid", TREEITEM:"treeitem"};
goog.dom.a11y.LivePriority = {OFF:"off", POLITE:"polite", ASSERTIVE:"assertive"};
goog.dom.a11y.setRole = function $goog$dom$a11y$setRole$(element, roleName) {
  element.setAttribute("role", roleName);
  element.roleName = roleName
};
goog.dom.a11y.getRole = function $goog$dom$a11y$getRole$(element) {
  return element.roleName || ""
};
goog.dom.a11y.setState = function $goog$dom$a11y$setState$(element, state, value) {
  element.setAttribute("aria-" + state, value)
};
goog.dom.a11y.getState = function $goog$dom$a11y$getState$(element, stateName) {
  var attrb = element.getAttribute("aria-" + stateName);
  return!0 === attrb || !1 === attrb ? attrb ? "true" : "false" : attrb ? "" + attrb : ""
};
goog.dom.a11y.getActiveDescendant = function $goog$dom$a11y$getActiveDescendant$(element) {
  var id = goog.dom.a11y.getState(element, goog.dom.a11y.State.ACTIVEDESCENDANT);
  return goog.dom.getOwnerDocument(element).getElementById(id)
};
goog.dom.a11y.setActiveDescendant = function $goog$dom$a11y$setActiveDescendant$(element, activeElement) {
  goog.dom.a11y.setState(element, goog.dom.a11y.State.ACTIVEDESCENDANT, activeElement ? activeElement.id : "")
};
goog.dom.a11y.Announcer = function $goog$dom$a11y$Announcer$(domHelper) {
  goog.Disposable.call(this);
  this.domHelper_ = domHelper;
  this.liveRegions_ = {}
};
goog.inherits(goog.dom.a11y.Announcer, goog.Disposable);
goog.dom.a11y.Announcer.prototype.disposeInternal = function $goog$dom$a11y$Announcer$$disposeInternal$() {
  goog.object.forEach(this.liveRegions_, this.domHelper_.removeNode, this.domHelper_);
  this.domHelper_ = this.liveRegions_ = null;
  goog.dom.a11y.Announcer.superClass_.disposeInternal.call(this)
};
goog.ui.registry = {};
goog.ui.registry.getDefaultRenderer = function $goog$ui$registry$getDefaultRenderer$(componentCtor) {
  for(var key, rendererCtor;componentCtor;) {
    key = goog.getUid(componentCtor);
    if(rendererCtor = goog.ui.registry.defaultRenderers_[key]) {
      break
    }
    componentCtor = componentCtor.superClass_ ? componentCtor.superClass_.constructor : null
  }
  return rendererCtor ? goog.isFunction(rendererCtor.getInstance) ? rendererCtor.getInstance() : new rendererCtor : null
};
goog.ui.registry.setDefaultRenderer = function $goog$ui$registry$setDefaultRenderer$(componentCtor, rendererCtor) {
  if(!goog.isFunction(componentCtor)) {
    throw Error("Invalid component class " + componentCtor);
  }
  if(!goog.isFunction(rendererCtor)) {
    throw Error("Invalid renderer class " + rendererCtor);
  }
  var key = goog.getUid(componentCtor);
  goog.ui.registry.defaultRenderers_[key] = rendererCtor
};
goog.ui.registry.getDecoratorByClassName = function $goog$ui$registry$getDecoratorByClassName$(className) {
  return className in goog.ui.registry.decoratorFunctions_ ? goog.ui.registry.decoratorFunctions_[className]() : null
};
goog.ui.registry.setDecoratorByClassName = function $goog$ui$registry$setDecoratorByClassName$(className, decoratorFn) {
  if(!className) {
    throw Error("Invalid class name " + className);
  }
  if(!goog.isFunction(decoratorFn)) {
    throw Error("Invalid decorator function " + decoratorFn);
  }
  goog.ui.registry.decoratorFunctions_[className] = decoratorFn
};
goog.ui.registry.getDecorator = function $goog$ui$registry$getDecorator$(element) {
  for(var decorator, classNames = goog.dom.classes.get(element), i = 0, len = classNames.length;i < len;i++) {
    if(decorator = goog.ui.registry.getDecoratorByClassName(classNames[i])) {
      return decorator
    }
  }
  return null
};
goog.ui.registry.reset = function $goog$ui$registry$reset$() {
  goog.ui.registry.defaultRenderers_ = {};
  goog.ui.registry.decoratorFunctions_ = {}
};
goog.ui.registry.defaultRenderers_ = {};
goog.ui.registry.decoratorFunctions_ = {};
goog.ui.ControlRenderer = function $goog$ui$ControlRenderer$() {
};
goog.addSingletonGetter(goog.ui.ControlRenderer);
goog.ui.ControlRenderer.getCustomRenderer = function $goog$ui$ControlRenderer$getCustomRenderer$(ctor, cssClassName) {
  var renderer = new ctor;
  renderer.getCssClass = function $renderer$getCssClass$() {
    return cssClassName
  };
  return renderer
};
goog.ui.ControlRenderer.CSS_CLASS = "ita-control";
goog.ui.ControlRenderer.IE6_CLASS_COMBINATIONS = [];
goog.ui.ControlRenderer.prototype.getAriaRole = function $goog$ui$ControlRenderer$$getAriaRole$() {
};
goog.ui.ControlRenderer.prototype.createDom = function $goog$ui$ControlRenderer$$createDom$(control) {
  var element = control.getDomHelper().createDom("div", this.getClassNames(control).join(" "), control.getContent());
  this.setAriaStates(control, element);
  return element
};
goog.ui.ControlRenderer.prototype.getContentElement = function $goog$ui$ControlRenderer$$getContentElement$(element) {
  return element
};
goog.ui.ControlRenderer.prototype.enableClassName = function $goog$ui$ControlRenderer$$enableClassName$(control, className, enable) {
  var element = control.getElement ? control.getElement() : control;
  if(element) {
    if(goog.userAgent.IE && !goog.userAgent.isVersion("7")) {
      var combinedClasses = this.getAppliedCombinedClassNames_(goog.dom.classes.get(element), className);
      combinedClasses.push(className);
      var f = enable ? goog.dom.classes.add : goog.dom.classes.remove;
      goog.partial(f, element).apply(null, combinedClasses)
    }else {
      goog.dom.classes.enable(element, className, enable)
    }
  }
};
goog.ui.ControlRenderer.prototype.enableExtraClassName = function $goog$ui$ControlRenderer$$enableExtraClassName$(control, className, enable) {
  this.enableClassName(control, className, enable)
};
goog.ui.ControlRenderer.prototype.canDecorate = function $goog$ui$ControlRenderer$$canDecorate$() {
  return!0
};
goog.ui.ControlRenderer.prototype.decorate = function $goog$ui$ControlRenderer$$decorate$(control, element) {
  element.id && control.setId(element.id);
  var contentElem = this.getContentElement(element);
  contentElem && contentElem.firstChild ? control.setContentInternal(contentElem.firstChild.nextSibling ? goog.array.clone(contentElem.childNodes) : contentElem.firstChild) : control.setContentInternal(null);
  var state = 0, rendererClassName = this.getCssClass(), structuralClassName = this.getStructuralCssClass(), hasRendererClassName = !1, hasStructuralClassName = !1, hasCombinedClassName = !1, classNames = goog.dom.classes.get(element);
  goog.array.forEach(classNames, function(className) {
    !hasRendererClassName && className == rendererClassName ? (hasRendererClassName = !0, structuralClassName == rendererClassName && (hasStructuralClassName = !0)) : !hasStructuralClassName && className == structuralClassName ? hasStructuralClassName = !0 : state |= this.getStateFromClass(className)
  }, this);
  control.setStateInternal(state);
  hasRendererClassName || (classNames.push(rendererClassName), structuralClassName == rendererClassName && (hasStructuralClassName = !0));
  hasStructuralClassName || classNames.push(structuralClassName);
  var extraClassNames = control.getExtraClassNames();
  extraClassNames && classNames.push.apply(classNames, extraClassNames);
  if(goog.userAgent.IE && !goog.userAgent.isVersion("7")) {
    var combinedClasses = this.getAppliedCombinedClassNames_(classNames);
    0 < combinedClasses.length && (classNames.push.apply(classNames, combinedClasses), hasCombinedClassName = !0)
  }
  (!hasRendererClassName || !hasStructuralClassName || extraClassNames || hasCombinedClassName) && goog.dom.classes.set(element, classNames.join(" "));
  this.setAriaStates(control, element);
  return element
};
goog.ui.ControlRenderer.prototype.initializeDom = function $goog$ui$ControlRenderer$$initializeDom$(control) {
  control.isRightToLeft() && this.setRightToLeft(control.getElement(), !0);
  control.isEnabled() && this.setFocusable(control, control.isVisible())
};
goog.ui.ControlRenderer.prototype.setAriaRole = function $goog$ui$ControlRenderer$$setAriaRole$(element, opt_preferredRole) {
  var ariaRole = opt_preferredRole || this.getAriaRole();
  ariaRole && goog.dom.a11y.setRole(element, ariaRole)
};
goog.ui.ControlRenderer.prototype.setAriaStates = function $goog$ui$ControlRenderer$$setAriaStates$(control, element) {
  goog.asserts.assert(control);
  goog.asserts.assert(element);
  control.isEnabled() || this.updateAriaState(element, goog.ui.Component.State.DISABLED, !0);
  control.isSelected() && this.updateAriaState(element, goog.ui.Component.State.SELECTED, !0);
  control.isSupportedState(goog.ui.Component.State.CHECKED) && this.updateAriaState(element, goog.ui.Component.State.CHECKED, control.isChecked());
  control.isSupportedState(goog.ui.Component.State.OPENED) && this.updateAriaState(element, goog.ui.Component.State.OPENED, control.isOpen())
};
goog.ui.ControlRenderer.prototype.setAllowTextSelection = function $goog$ui$ControlRenderer$$setAllowTextSelection$(element, allow) {
  goog.style.setUnselectable(element, !allow, !goog.userAgent.IE && !goog.userAgent.OPERA)
};
goog.ui.ControlRenderer.prototype.setRightToLeft = function $goog$ui$ControlRenderer$$setRightToLeft$(element, rightToLeft) {
  this.enableClassName(element, this.getStructuralCssClass() + "-rtl", rightToLeft)
};
goog.ui.ControlRenderer.prototype.isFocusable = function $goog$ui$ControlRenderer$$isFocusable$(control) {
  var keyTarget;
  return control.isSupportedState(goog.ui.Component.State.FOCUSED) && (keyTarget = control.getKeyEventTarget()) ? goog.dom.isFocusableTabIndex(keyTarget) : !1
};
goog.ui.ControlRenderer.prototype.setFocusable = function $goog$ui$ControlRenderer$$setFocusable$(control, focusable) {
  var keyTarget;
  if(control.isSupportedState(goog.ui.Component.State.FOCUSED) && (keyTarget = control.getKeyEventTarget())) {
    if(!focusable && control.isFocused()) {
      try {
        keyTarget.blur()
      }catch(e) {
      }
      control.isFocused() && control.handleBlur(null)
    }
    goog.dom.isFocusableTabIndex(keyTarget) != focusable && goog.dom.setFocusableTabIndex(keyTarget, focusable)
  }
};
goog.ui.ControlRenderer.prototype.setVisible = function $goog$ui$ControlRenderer$$setVisible$(element, visible) {
  goog.style.showElement(element, visible)
};
goog.ui.ControlRenderer.prototype.setState = function $goog$ui$ControlRenderer$$setState$(control, state, enable) {
  var element = control.getElement();
  if(element) {
    var className = this.getClassForState(state);
    className && this.enableClassName(control, className, enable);
    this.updateAriaState(element, state, enable)
  }
};
goog.ui.ControlRenderer.prototype.updateAriaState = function $goog$ui$ControlRenderer$$updateAriaState$(element, state, enable) {
  goog.ui.ControlRenderer.ARIA_STATE_MAP_ || (goog.ui.ControlRenderer.ARIA_STATE_MAP_ = goog.object.create(goog.ui.Component.State.DISABLED, goog.dom.a11y.State.DISABLED, goog.ui.Component.State.SELECTED, goog.dom.a11y.State.SELECTED, goog.ui.Component.State.CHECKED, goog.dom.a11y.State.CHECKED, goog.ui.Component.State.OPENED, goog.dom.a11y.State.EXPANDED));
  var ariaState = goog.ui.ControlRenderer.ARIA_STATE_MAP_[state];
  ariaState && goog.dom.a11y.setState(element, ariaState, enable)
};
goog.ui.ControlRenderer.prototype.getKeyEventTarget = function $goog$ui$ControlRenderer$$getKeyEventTarget$(control) {
  return control.getElement()
};
goog.ui.ControlRenderer.prototype.getCssClass = function $goog$ui$ControlRenderer$$getCssClass$() {
  return goog.ui.ControlRenderer.CSS_CLASS
};
goog.ui.ControlRenderer.prototype.getIe6ClassCombinations = function $goog$ui$ControlRenderer$$getIe6ClassCombinations$() {
  return[]
};
goog.ui.ControlRenderer.prototype.getStructuralCssClass = function $goog$ui$ControlRenderer$$getStructuralCssClass$() {
  return this.getCssClass()
};
goog.ui.ControlRenderer.prototype.getClassNames = function $goog$ui$ControlRenderer$$getClassNames$(control) {
  var cssClass = this.getCssClass(), classNames = [cssClass], structuralCssClass = this.getStructuralCssClass();
  structuralCssClass != cssClass && classNames.push(structuralCssClass);
  var classNamesForState = this.getClassNamesForState(control.getState());
  classNames.push.apply(classNames, classNamesForState);
  var extraClassNames = control.getExtraClassNames();
  extraClassNames && classNames.push.apply(classNames, extraClassNames);
  goog.userAgent.IE && !goog.userAgent.isVersion("7") && classNames.push.apply(classNames, this.getAppliedCombinedClassNames_(classNames));
  return classNames
};
goog.ui.ControlRenderer.prototype.getAppliedCombinedClassNames_ = function $goog$ui$ControlRenderer$$getAppliedCombinedClassNames_$(classes, opt_includedClass) {
  var toAdd = [];
  opt_includedClass && (classes = classes.concat([opt_includedClass]));
  goog.array.forEach(this.getIe6ClassCombinations(), function(combo) {
    goog.array.every(combo, goog.partial(goog.array.contains, classes)) && (!opt_includedClass || goog.array.contains(combo, opt_includedClass)) && toAdd.push(combo.join("_"))
  });
  return toAdd
};
goog.ui.ControlRenderer.prototype.getClassNamesForState = function $goog$ui$ControlRenderer$$getClassNamesForState$(state) {
  for(var classNames = [];state;) {
    var mask = state & -state;
    classNames.push(this.getClassForState(mask));
    state &= ~mask
  }
  return classNames
};
goog.ui.ControlRenderer.prototype.getClassForState = function $goog$ui$ControlRenderer$$getClassForState$(state) {
  this.classByState_ || this.createClassByStateMap_();
  return this.classByState_[state]
};
goog.ui.ControlRenderer.prototype.getStateFromClass = function $goog$ui$ControlRenderer$$getStateFromClass$(className) {
  this.stateByClass_ || this.createStateByClassMap_();
  var state = parseInt(this.stateByClass_[className], 10);
  return isNaN(state) ? 0 : state
};
goog.ui.ControlRenderer.prototype.createClassByStateMap_ = function $goog$ui$ControlRenderer$$createClassByStateMap_$() {
  var baseClass = this.getStructuralCssClass();
  this.classByState_ = goog.object.create(goog.ui.Component.State.DISABLED, baseClass + "-disabled", goog.ui.Component.State.HOVER, baseClass + "-hover", goog.ui.Component.State.ACTIVE, baseClass + "-active", goog.ui.Component.State.SELECTED, baseClass + "-selected", goog.ui.Component.State.CHECKED, baseClass + "-checked", goog.ui.Component.State.FOCUSED, baseClass + "-focused", goog.ui.Component.State.OPENED, baseClass + "-open")
};
goog.ui.ControlRenderer.prototype.createStateByClassMap_ = function $goog$ui$ControlRenderer$$createStateByClassMap_$() {
  this.classByState_ || this.createClassByStateMap_();
  this.stateByClass_ = goog.object.transpose(this.classByState_)
};
goog.ui.decorate = function $goog$ui$decorate$(element) {
  var decorator = goog.ui.registry.getDecorator(element);
  decorator && decorator.decorate(element);
  return decorator
};
goog.ui.Control = function $goog$ui$Control$(content, opt_renderer, opt_domHelper) {
  goog.ui.Component.call(this, opt_domHelper);
  this.renderer_ = opt_renderer || goog.ui.registry.getDefaultRenderer(this.constructor);
  this.setContentInternal(content)
};
goog.inherits(goog.ui.Control, goog.ui.Component);
goog.ui.Control.registerDecorator = goog.ui.registry.setDecoratorByClassName;
goog.ui.Control.getDecorator = goog.ui.registry.getDecorator;
goog.ui.Control.decorate = goog.ui.decorate;
goog.ui.Control.prototype.content_ = null;
goog.ui.Control.prototype.state_ = 0;
goog.ui.Control.prototype.supportedStates_ = goog.ui.Component.State.DISABLED | goog.ui.Component.State.HOVER | goog.ui.Component.State.ACTIVE | goog.ui.Component.State.FOCUSED;
goog.ui.Control.prototype.autoStates_ = goog.ui.Component.State.ALL;
goog.ui.Control.prototype.statesWithTransitionEvents_ = 0;
goog.ui.Control.prototype.visible_ = !0;
goog.ui.Control.prototype.extraClassNames_ = null;
goog.ui.Control.prototype.handleMouseEvents_ = !0;
goog.ui.Control.prototype.allowTextSelection_ = !1;
goog.ui.Control.prototype.preferredAriaRole_ = null;
goog.ui.Control.prototype.isHandleMouseEvents = function $goog$ui$Control$$isHandleMouseEvents$() {
  return this.handleMouseEvents_
};
goog.ui.Control.prototype.setHandleMouseEvents = function $goog$ui$Control$$setHandleMouseEvents$(enable) {
  this.isInDocument() && enable != this.handleMouseEvents_ && this.enableMouseEventHandling_(enable);
  this.handleMouseEvents_ = enable
};
goog.ui.Control.prototype.getKeyEventTarget = function $goog$ui$Control$$getKeyEventTarget$() {
  return this.renderer_.getKeyEventTarget(this)
};
goog.ui.Control.prototype.getKeyHandler = function $goog$ui$Control$$getKeyHandler$() {
  return this.keyHandler_ || (this.keyHandler_ = new goog.events.KeyHandler)
};
goog.ui.Control.prototype.getRenderer = function $goog$ui$Control$$getRenderer$() {
  return this.renderer_
};
goog.ui.Control.prototype.getExtraClassNames = function $goog$ui$Control$$getExtraClassNames$() {
  return this.extraClassNames_
};
goog.ui.Control.prototype.addClassName = function $goog$ui$Control$$addClassName$(className) {
  className && (this.extraClassNames_ ? goog.array.contains(this.extraClassNames_, className) || this.extraClassNames_.push(className) : this.extraClassNames_ = [className], this.renderer_.enableExtraClassName(this, className, !0))
};
goog.ui.Control.prototype.removeClassName = function $goog$ui$Control$$removeClassName$(className) {
  className && this.extraClassNames_ && (goog.array.remove(this.extraClassNames_, className), 0 == this.extraClassNames_.length && (this.extraClassNames_ = null), this.renderer_.enableExtraClassName(this, className, !1))
};
goog.ui.Control.prototype.enableClassName = function $goog$ui$Control$$enableClassName$(className, enable) {
  enable ? this.addClassName(className) : this.removeClassName(className)
};
goog.ui.Control.prototype.createDom = function $goog$ui$Control$$createDom$() {
  var element = this.renderer_.createDom(this);
  this.setElementInternal(element);
  this.renderer_.setAriaRole(element, this.getPreferredAriaRole());
  this.isAllowTextSelection() || this.renderer_.setAllowTextSelection(element, !1);
  this.isVisible() || this.renderer_.setVisible(element, !1)
};
goog.ui.Control.prototype.getPreferredAriaRole = function $goog$ui$Control$$getPreferredAriaRole$() {
  return this.preferredAriaRole_
};
goog.ui.Control.prototype.getContentElement = function $goog$ui$Control$$getContentElement$() {
  return this.renderer_.getContentElement(this.getElement())
};
goog.ui.Control.prototype.canDecorate = function $goog$ui$Control$$canDecorate$(element) {
  return this.renderer_.canDecorate(element)
};
goog.ui.Control.prototype.decorateInternal = function $goog$ui$Control$$decorateInternal$(element) {
  element = this.renderer_.decorate(this, element);
  this.setElementInternal(element);
  this.renderer_.setAriaRole(element, this.getPreferredAriaRole());
  this.isAllowTextSelection() || this.renderer_.setAllowTextSelection(element, !1);
  this.visible_ = "none" != element.style.display
};
goog.ui.Control.prototype.enterDocument = function $goog$ui$Control$$enterDocument$() {
  goog.ui.Control.superClass_.enterDocument.call(this);
  this.renderer_.initializeDom(this);
  if(this.supportedStates_ & ~goog.ui.Component.State.DISABLED && (this.isHandleMouseEvents() && this.enableMouseEventHandling_(!0), this.isSupportedState(goog.ui.Component.State.FOCUSED))) {
    var keyTarget = this.getKeyEventTarget();
    if(keyTarget) {
      var keyHandler = this.getKeyHandler();
      keyHandler.attach(keyTarget);
      this.getHandler().listen(keyHandler, goog.events.KeyHandler.EventType.KEY, this.handleKeyEvent).listen(keyTarget, goog.events.EventType.FOCUS, this.handleFocus).listen(keyTarget, goog.events.EventType.BLUR, this.handleBlur)
    }
  }
};
goog.ui.Control.prototype.enableMouseEventHandling_ = function $goog$ui$Control$$enableMouseEventHandling_$(enable) {
  var handler = this.getHandler(), element = this.getElement();
  enable ? (handler.listen(element, goog.events.EventType.MOUSEOVER, this.handleMouseOver).listen(element, goog.events.EventType.MOUSEDOWN, this.handleMouseDown).listen(element, goog.events.EventType.MOUSEUP, this.handleMouseUp).listen(element, goog.events.EventType.MOUSEOUT, this.handleMouseOut), goog.userAgent.IE && handler.listen(element, goog.events.EventType.DBLCLICK, this.handleDblClick)) : (handler.unlisten(element, goog.events.EventType.MOUSEOVER, this.handleMouseOver).unlisten(element, goog.events.EventType.MOUSEDOWN, 
  this.handleMouseDown).unlisten(element, goog.events.EventType.MOUSEUP, this.handleMouseUp).unlisten(element, goog.events.EventType.MOUSEOUT, this.handleMouseOut), goog.userAgent.IE && handler.unlisten(element, goog.events.EventType.DBLCLICK, this.handleDblClick))
};
goog.ui.Control.prototype.exitDocument = function $goog$ui$Control$$exitDocument$() {
  goog.ui.Control.superClass_.exitDocument.call(this);
  this.keyHandler_ && this.keyHandler_.detach();
  this.isVisible() && this.isEnabled() && this.renderer_.setFocusable(this, !1)
};
goog.ui.Control.prototype.disposeInternal = function $goog$ui$Control$$disposeInternal$() {
  goog.ui.Control.superClass_.disposeInternal.call(this);
  this.keyHandler_ && (this.keyHandler_.dispose(), delete this.keyHandler_);
  delete this.renderer_;
  this.extraClassNames_ = this.content_ = null
};
goog.ui.Control.prototype.getContent = function $goog$ui$Control$$getContent$() {
  return this.content_
};
goog.ui.Control.prototype.setContentInternal = function $goog$ui$Control$$setContentInternal$(content) {
  this.content_ = content
};
goog.ui.Control.prototype.getCaption = function $goog$ui$Control$$getCaption$() {
  var content = this.getContent();
  if(!content) {
    return""
  }
  var caption = goog.isString(content) ? content : goog.isArray(content) ? goog.array.map(content, goog.dom.getRawTextContent).join("") : goog.dom.getTextContent(content);
  return goog.string.collapseBreakingSpaces(caption)
};
goog.ui.Control.prototype.setRightToLeft = function $goog$ui$Control$$setRightToLeft$(rightToLeft) {
  goog.ui.Control.superClass_.setRightToLeft.call(this, rightToLeft);
  var element = this.getElement();
  element && this.renderer_.setRightToLeft(element, rightToLeft)
};
goog.ui.Control.prototype.isAllowTextSelection = function $goog$ui$Control$$isAllowTextSelection$() {
  return this.allowTextSelection_
};
goog.ui.Control.prototype.setAllowTextSelection = function $goog$ui$Control$$setAllowTextSelection$(allow) {
  this.allowTextSelection_ = allow;
  var element = this.getElement();
  element && this.renderer_.setAllowTextSelection(element, allow)
};
goog.ui.Control.prototype.isVisible = function $goog$ui$Control$$isVisible$() {
  return this.visible_
};
goog.ui.Control.prototype.setVisible = function $goog$ui$Control$$setVisible$(visible, opt_force) {
  if(opt_force || this.visible_ != visible && this.dispatchEvent(visible ? goog.ui.Component.EventType.SHOW : goog.ui.Component.EventType.HIDE)) {
    var element = this.getElement();
    element && this.renderer_.setVisible(element, visible);
    this.isEnabled() && this.renderer_.setFocusable(this, visible);
    this.visible_ = visible;
    return!0
  }
  return!1
};
goog.ui.Control.prototype.isEnabled = function $goog$ui$Control$$isEnabled$() {
  return!this.hasState(goog.ui.Component.State.DISABLED)
};
goog.ui.Control.prototype.isParentDisabled_ = function $goog$ui$Control$$isParentDisabled_$() {
  var parent = this.getParent();
  return!!parent && "function" == typeof parent.isEnabled && !parent.isEnabled()
};
goog.ui.Control.prototype.setEnabled = function $goog$ui$Control$$setEnabled$(enable) {
  !this.isParentDisabled_() && this.isTransitionAllowed(goog.ui.Component.State.DISABLED, !enable) && (enable || (this.setActive(!1), this.setHighlighted(!1)), this.isVisible() && this.renderer_.setFocusable(this, enable), this.setState(goog.ui.Component.State.DISABLED, !enable))
};
goog.ui.Control.prototype.setHighlighted = function $goog$ui$Control$$setHighlighted$(highlight) {
  this.isTransitionAllowed(goog.ui.Component.State.HOVER, highlight) && this.setState(goog.ui.Component.State.HOVER, highlight)
};
goog.ui.Control.prototype.isActive = function $goog$ui$Control$$isActive$() {
  return this.hasState(goog.ui.Component.State.ACTIVE)
};
goog.ui.Control.prototype.setActive = function $goog$ui$Control$$setActive$(active) {
  this.isTransitionAllowed(goog.ui.Component.State.ACTIVE, active) && this.setState(goog.ui.Component.State.ACTIVE, active)
};
goog.ui.Control.prototype.isSelected = function $goog$ui$Control$$isSelected$() {
  return this.hasState(goog.ui.Component.State.SELECTED)
};
goog.ui.Control.prototype.setSelected = function $goog$ui$Control$$setSelected$(select) {
  this.isTransitionAllowed(goog.ui.Component.State.SELECTED, select) && this.setState(goog.ui.Component.State.SELECTED, select)
};
goog.ui.Control.prototype.isChecked = function $goog$ui$Control$$isChecked$() {
  return this.hasState(goog.ui.Component.State.CHECKED)
};
goog.ui.Control.prototype.setChecked = function $goog$ui$Control$$setChecked$(check) {
  this.isTransitionAllowed(goog.ui.Component.State.CHECKED, check) && this.setState(goog.ui.Component.State.CHECKED, check)
};
goog.ui.Control.prototype.isFocused = function $goog$ui$Control$$isFocused$() {
  return this.hasState(goog.ui.Component.State.FOCUSED)
};
goog.ui.Control.prototype.setFocused = function $goog$ui$Control$$setFocused$(focused) {
  this.isTransitionAllowed(goog.ui.Component.State.FOCUSED, focused) && this.setState(goog.ui.Component.State.FOCUSED, focused)
};
goog.ui.Control.prototype.isOpen = function $goog$ui$Control$$isOpen$() {
  return this.hasState(goog.ui.Component.State.OPENED)
};
goog.ui.Control.prototype.setOpen = function $goog$ui$Control$$setOpen$(open) {
  this.isTransitionAllowed(goog.ui.Component.State.OPENED, open) && this.setState(goog.ui.Component.State.OPENED, open)
};
goog.ui.Control.prototype.getState = function $goog$ui$Control$$getState$() {
  return this.state_
};
goog.ui.Control.prototype.hasState = function $goog$ui$Control$$hasState$(state) {
  return!!(this.state_ & state)
};
goog.ui.Control.prototype.setState = function $goog$ui$Control$$setState$(state, enable) {
  this.isSupportedState(state) && enable != this.hasState(state) && (this.renderer_.setState(this, state, enable), this.state_ = enable ? this.state_ | state : this.state_ & ~state)
};
goog.ui.Control.prototype.setStateInternal = function $goog$ui$Control$$setStateInternal$(state) {
  this.state_ = state
};
goog.ui.Control.prototype.isSupportedState = function $goog$ui$Control$$isSupportedState$(state) {
  return!!(this.supportedStates_ & state)
};
goog.ui.Control.prototype.setSupportedState = function $goog$ui$Control$$setSupportedState$(state, support) {
  if(this.isInDocument() && this.hasState(state) && !support) {
    throw Error(goog.ui.Component.Error.ALREADY_RENDERED);
  }
  !support && this.hasState(state) && this.setState(state, !1);
  this.supportedStates_ = support ? this.supportedStates_ | state : this.supportedStates_ & ~state
};
goog.ui.Control.prototype.isAutoState = function $goog$ui$Control$$isAutoState$(state) {
  return!!(this.autoStates_ & state) && this.isSupportedState(state)
};
goog.ui.Control.prototype.setAutoStates = function $goog$ui$Control$$setAutoStates$(states, enable) {
  this.autoStates_ = enable ? this.autoStates_ | states : this.autoStates_ & ~states
};
goog.ui.Control.prototype.setDispatchTransitionEvents = function $goog$ui$Control$$setDispatchTransitionEvents$(states, enable) {
  this.statesWithTransitionEvents_ = enable ? this.statesWithTransitionEvents_ | states : this.statesWithTransitionEvents_ & ~states
};
goog.ui.Control.prototype.isTransitionAllowed = function $goog$ui$Control$$isTransitionAllowed$(state, enable) {
  return this.isSupportedState(state) && this.hasState(state) != enable && (!(this.statesWithTransitionEvents_ & state) || this.dispatchEvent(goog.ui.Component.getStateTransitionEvent(state, enable))) && !this.isDisposed()
};
goog.ui.Control.prototype.handleMouseOver = function $goog$ui$Control$$handleMouseOver$(e) {
  !goog.ui.Control.isMouseEventWithinElement_(e, this.getElement()) && this.dispatchEvent(goog.ui.Component.EventType.ENTER) && this.isEnabled() && this.isAutoState(goog.ui.Component.State.HOVER) && this.setHighlighted(!0)
};
goog.ui.Control.prototype.handleMouseOut = function $goog$ui$Control$$handleMouseOut$(e) {
  !goog.ui.Control.isMouseEventWithinElement_(e, this.getElement()) && this.dispatchEvent(goog.ui.Component.EventType.LEAVE) && (this.isAutoState(goog.ui.Component.State.ACTIVE) && this.setActive(!1), this.isAutoState(goog.ui.Component.State.HOVER) && this.setHighlighted(!1))
};
goog.ui.Control.isMouseEventWithinElement_ = function $goog$ui$Control$isMouseEventWithinElement_$(e, elem) {
  return!!e.relatedTarget && goog.dom.contains(elem, e.relatedTarget)
};
goog.ui.Control.prototype.handleMouseDown = function $goog$ui$Control$$handleMouseDown$(e) {
  this.isEnabled() && (this.isAutoState(goog.ui.Component.State.HOVER) && this.setHighlighted(!0), e.isMouseActionButton() && (this.isAutoState(goog.ui.Component.State.ACTIVE) && this.setActive(!0), this.renderer_.isFocusable(this) && this.getKeyEventTarget().focus()));
  !this.isAllowTextSelection() && e.isMouseActionButton() && e.preventDefault()
};
goog.ui.Control.prototype.handleMouseUp = function $goog$ui$Control$$handleMouseUp$(e) {
  this.isEnabled() && (this.isAutoState(goog.ui.Component.State.HOVER) && this.setHighlighted(!0), this.isActive() && this.performActionInternal(e) && this.isAutoState(goog.ui.Component.State.ACTIVE) && this.setActive(!1))
};
goog.ui.Control.prototype.handleDblClick = function $goog$ui$Control$$handleDblClick$(e) {
  this.isEnabled() && this.performActionInternal(e)
};
goog.ui.Control.prototype.performActionInternal = function $goog$ui$Control$$performActionInternal$(e) {
  this.isAutoState(goog.ui.Component.State.CHECKED) && this.setChecked(!this.isChecked());
  this.isAutoState(goog.ui.Component.State.SELECTED) && this.setSelected(!0);
  this.isAutoState(goog.ui.Component.State.OPENED) && this.setOpen(!this.isOpen());
  var actionEvent = new goog.events.Event(goog.ui.Component.EventType.ACTION, this);
  e && (actionEvent.altKey = e.altKey, actionEvent.ctrlKey = e.ctrlKey, actionEvent.metaKey = e.metaKey, actionEvent.shiftKey = e.shiftKey, actionEvent.platformModifierKey = e.platformModifierKey);
  return this.dispatchEvent(actionEvent)
};
goog.ui.Control.prototype.handleFocus = function $goog$ui$Control$$handleFocus$() {
  this.isAutoState(goog.ui.Component.State.FOCUSED) && this.setFocused(!0)
};
goog.ui.Control.prototype.handleBlur = function $goog$ui$Control$$handleBlur$() {
  this.isAutoState(goog.ui.Component.State.ACTIVE) && this.setActive(!1);
  this.isAutoState(goog.ui.Component.State.FOCUSED) && this.setFocused(!1)
};
goog.ui.Control.prototype.handleKeyEvent = function $goog$ui$Control$$handleKeyEvent$(e) {
  return this.isVisible() && this.isEnabled() && this.handleKeyEventInternal(e) ? (e.preventDefault(), e.stopPropagation(), !0) : !1
};
goog.ui.Control.prototype.handleKeyEventInternal = function $goog$ui$Control$$handleKeyEventInternal$(e) {
  return e.keyCode == goog.events.KeyCodes.ENTER && this.performActionInternal(e)
};
goog.ui.registry.setDefaultRenderer(goog.ui.Control, goog.ui.ControlRenderer);
goog.ui.registry.setDecoratorByClassName(goog.ui.ControlRenderer.CSS_CLASS, function() {
  return new goog.ui.Control(null)
});
goog.ui.MenuSeparatorRenderer = function $goog$ui$MenuSeparatorRenderer$() {
};
goog.inherits(goog.ui.MenuSeparatorRenderer, goog.ui.ControlRenderer);
goog.addSingletonGetter(goog.ui.MenuSeparatorRenderer);
goog.ui.MenuSeparatorRenderer.CSS_CLASS = "ita-menuseparator";
goog.ui.MenuSeparatorRenderer.prototype.createDom = function $goog$ui$MenuSeparatorRenderer$$createDom$(separator) {
  return separator.getDomHelper().createDom("div", this.getCssClass())
};
goog.ui.MenuSeparatorRenderer.prototype.decorate = function $goog$ui$MenuSeparatorRenderer$$decorate$(separator, element) {
  element.id && separator.setId(element.id);
  if("HR" == element.tagName) {
    var hr = element, element = this.createDom(separator);
    goog.dom.insertSiblingBefore(element, hr);
    goog.dom.removeNode(hr)
  }else {
    goog.dom.classes.add(element, this.getCssClass())
  }
  return element
};
goog.ui.MenuSeparatorRenderer.prototype.getCssClass = function $goog$ui$MenuSeparatorRenderer$$getCssClass$() {
  return goog.ui.MenuSeparatorRenderer.CSS_CLASS
};
goog.ui.Separator = function $goog$ui$Separator$(opt_renderer, opt_domHelper) {
  goog.ui.Control.call(this, null, opt_renderer || goog.ui.MenuSeparatorRenderer.getInstance(), opt_domHelper);
  this.setSupportedState(goog.ui.Component.State.DISABLED, !1);
  this.setSupportedState(goog.ui.Component.State.HOVER, !1);
  this.setSupportedState(goog.ui.Component.State.ACTIVE, !1);
  this.setSupportedState(goog.ui.Component.State.FOCUSED, !1);
  this.setStateInternal(goog.ui.Component.State.DISABLED)
};
goog.inherits(goog.ui.Separator, goog.ui.Control);
goog.ui.Separator.prototype.enterDocument = function $goog$ui$Separator$$enterDocument$() {
  goog.ui.Separator.superClass_.enterDocument.call(this);
  goog.dom.a11y.setRole(this.getElement(), "separator")
};
goog.ui.registry.setDecoratorByClassName(goog.ui.MenuSeparatorRenderer.CSS_CLASS, function() {
  return new goog.ui.Separator
});
goog.ui.ContainerRenderer = function $goog$ui$ContainerRenderer$() {
};
goog.addSingletonGetter(goog.ui.ContainerRenderer);
goog.ui.ContainerRenderer.getCustomRenderer = function $goog$ui$ContainerRenderer$getCustomRenderer$(ctor, cssClassName) {
  var renderer = new ctor;
  renderer.getCssClass = function $renderer$getCssClass$() {
    return cssClassName
  };
  return renderer
};
goog.ui.ContainerRenderer.CSS_CLASS = "ita-container";
goog.ui.ContainerRenderer.prototype.getAriaRole = function $goog$ui$ContainerRenderer$$getAriaRole$() {
};
goog.ui.ContainerRenderer.prototype.enableTabIndex = function $goog$ui$ContainerRenderer$$enableTabIndex$(element, enable) {
  element && (element.tabIndex = enable ? 0 : -1)
};
goog.ui.ContainerRenderer.prototype.createDom = function $goog$ui$ContainerRenderer$$createDom$(container) {
  return container.getDomHelper().createDom("div", this.getClassNames(container).join(" "))
};
goog.ui.ContainerRenderer.prototype.getContentElement = function $goog$ui$ContainerRenderer$$getContentElement$(element) {
  return element
};
goog.ui.ContainerRenderer.prototype.canDecorate = function $goog$ui$ContainerRenderer$$canDecorate$(element) {
  return"DIV" == element.tagName
};
goog.ui.ContainerRenderer.prototype.decorate = function $goog$ui$ContainerRenderer$$decorate$(container, element) {
  element.id && container.setId(element.id);
  var baseClass = this.getCssClass(), hasBaseClass = !1, classNames = goog.dom.classes.get(element);
  classNames && goog.array.forEach(classNames, function(className) {
    className == baseClass ? hasBaseClass = !0 : className && this.setStateFromClassName(container, className, baseClass)
  }, this);
  hasBaseClass || goog.dom.classes.add(element, baseClass);
  this.decorateChildren(container, this.getContentElement(element));
  return element
};
goog.ui.ContainerRenderer.prototype.setStateFromClassName = function $goog$ui$ContainerRenderer$$setStateFromClassName$(container, className, baseClass) {
  className == baseClass + "-disabled" ? container.setEnabled(!1) : className == baseClass + "-horizontal" ? container.setOrientation(goog.ui.Container.Orientation.HORIZONTAL) : className == baseClass + "-vertical" && container.setOrientation(goog.ui.Container.Orientation.VERTICAL)
};
goog.ui.ContainerRenderer.prototype.decorateChildren = function $goog$ui$ContainerRenderer$$decorateChildren$(container, element, opt_firstChild) {
  if(element) {
    for(var node = opt_firstChild || element.firstChild, next;node && node.parentNode == element;) {
      next = node.nextSibling;
      if(node.nodeType == goog.dom.NodeType.ELEMENT) {
        var child = this.getDecoratorForChild(node);
        child && (child.setElementInternal(node), container.isEnabled() || child.setEnabled(!1), container.addChild(child), child.decorate(node))
      }else {
        (!node.nodeValue || "" == goog.string.trim(node.nodeValue)) && element.removeChild(node)
      }
      node = next
    }
  }
};
goog.ui.ContainerRenderer.prototype.getDecoratorForChild = function $goog$ui$ContainerRenderer$$getDecoratorForChild$(element) {
  return goog.ui.registry.getDecorator(element)
};
goog.ui.ContainerRenderer.prototype.initializeDom = function $goog$ui$ContainerRenderer$$initializeDom$(container) {
  var elem = container.getElement();
  goog.style.setUnselectable(elem, !0, goog.userAgent.GECKO);
  goog.userAgent.IE && (elem.hideFocus = !0);
  var ariaRole = this.getAriaRole();
  ariaRole && goog.dom.a11y.setRole(elem, ariaRole)
};
goog.ui.ContainerRenderer.prototype.getKeyEventTarget = function $goog$ui$ContainerRenderer$$getKeyEventTarget$(container) {
  return container.getElement()
};
goog.ui.ContainerRenderer.prototype.getCssClass = function $goog$ui$ContainerRenderer$$getCssClass$() {
  return goog.ui.ContainerRenderer.CSS_CLASS
};
goog.ui.ContainerRenderer.prototype.getClassNames = function $goog$ui$ContainerRenderer$$getClassNames$(container) {
  var baseClass = this.getCssClass(), isHorizontal = container.getOrientation() == goog.ui.Container.Orientation.HORIZONTAL, classNames = [baseClass, isHorizontal ? baseClass + "-horizontal" : baseClass + "-vertical"];
  container.isEnabled() || classNames.push(baseClass + "-disabled");
  return classNames
};
goog.ui.ContainerRenderer.prototype.getDefaultOrientation = function $goog$ui$ContainerRenderer$$getDefaultOrientation$() {
  return goog.ui.Container.Orientation.VERTICAL
};
goog.ui.Container = function $goog$ui$Container$(opt_orientation, opt_renderer, opt_domHelper) {
  goog.ui.Component.call(this, opt_domHelper);
  this.renderer_ = opt_renderer || goog.ui.ContainerRenderer.getInstance();
  this.orientation_ = opt_orientation || this.renderer_.getDefaultOrientation()
};
goog.inherits(goog.ui.Container, goog.ui.Component);
goog.ui.Container.EventType = {AFTER_SHOW:"aftershow", AFTER_HIDE:"afterhide"};
goog.ui.Container.Orientation = {HORIZONTAL:"horizontal", VERTICAL:"vertical"};
goog.ui.Container.prototype.keyEventTarget_ = null;
goog.ui.Container.prototype.keyHandler_ = null;
goog.ui.Container.prototype.renderer_ = null;
goog.ui.Container.prototype.orientation_ = null;
goog.ui.Container.prototype.visible_ = !0;
goog.ui.Container.prototype.enabled_ = !0;
goog.ui.Container.prototype.focusable_ = !0;
goog.ui.Container.prototype.highlightedIndex_ = -1;
goog.ui.Container.prototype.openItem_ = null;
goog.ui.Container.prototype.mouseButtonPressed_ = !1;
goog.ui.Container.prototype.allowFocusableChildren_ = !1;
goog.ui.Container.prototype.openFollowsHighlight_ = !0;
goog.ui.Container.prototype.childElementIdMap_ = null;
goog.ui.Container.prototype.getKeyEventTarget = function $goog$ui$Container$$getKeyEventTarget$() {
  return this.keyEventTarget_ || this.renderer_.getKeyEventTarget(this)
};
goog.ui.Container.prototype.getKeyHandler = function $goog$ui$Container$$getKeyHandler$() {
  return this.keyHandler_ || (this.keyHandler_ = new goog.events.KeyHandler(this.getKeyEventTarget()))
};
goog.ui.Container.prototype.getRenderer = function $goog$ui$Container$$getRenderer$() {
  return this.renderer_
};
goog.ui.Container.prototype.createDom = function $goog$ui$Container$$createDom$() {
  this.setElementInternal(this.renderer_.createDom(this))
};
goog.ui.Container.prototype.getContentElement = function $goog$ui$Container$$getContentElement$() {
  return this.renderer_.getContentElement(this.getElement())
};
goog.ui.Container.prototype.canDecorate = function $goog$ui$Container$$canDecorate$(element) {
  return this.renderer_.canDecorate(element)
};
goog.ui.Container.prototype.decorateInternal = function $goog$ui$Container$$decorateInternal$(element) {
  this.setElementInternal(this.renderer_.decorate(this, element));
  "none" == element.style.display && (this.visible_ = !1)
};
goog.ui.Container.prototype.enterDocument = function $goog$ui$Container$$enterDocument$() {
  goog.ui.Container.superClass_.enterDocument.call(this);
  this.forEachChild(function(child) {
    child.isInDocument() && this.registerChildId_(child)
  }, this);
  var elem = this.getElement();
  this.renderer_.initializeDom(this);
  this.setVisible(this.visible_, !0);
  this.getHandler().listen(this, goog.ui.Component.EventType.ENTER, this.handleEnterItem).listen(this, goog.ui.Component.EventType.HIGHLIGHT, this.handleHighlightItem).listen(this, goog.ui.Component.EventType.UNHIGHLIGHT, this.handleUnHighlightItem).listen(this, goog.ui.Component.EventType.OPEN, this.handleOpenItem).listen(this, goog.ui.Component.EventType.CLOSE, this.handleCloseItem).listen(elem, goog.events.EventType.MOUSEDOWN, this.handleMouseDown).listen(goog.dom.getOwnerDocument(elem), goog.events.EventType.MOUSEUP, 
  this.handleDocumentMouseUp).listen(elem, [goog.events.EventType.MOUSEDOWN, goog.events.EventType.MOUSEUP, goog.events.EventType.MOUSEOVER, goog.events.EventType.MOUSEOUT], this.handleChildMouseEvents);
  this.isFocusable() && this.enableFocusHandling_(!0)
};
goog.ui.Container.prototype.enableFocusHandling_ = function $goog$ui$Container$$enableFocusHandling_$(enable) {
  var handler = this.getHandler(), keyTarget = this.getKeyEventTarget();
  enable ? handler.listen(keyTarget, goog.events.EventType.FOCUS, this.handleFocus).listen(keyTarget, goog.events.EventType.BLUR, this.handleBlur).listen(this.getKeyHandler(), goog.events.KeyHandler.EventType.KEY, this.handleKeyEvent) : handler.unlisten(keyTarget, goog.events.EventType.FOCUS, this.handleFocus).unlisten(keyTarget, goog.events.EventType.BLUR, this.handleBlur).unlisten(this.getKeyHandler(), goog.events.KeyHandler.EventType.KEY, this.handleKeyEvent)
};
goog.ui.Container.prototype.exitDocument = function $goog$ui$Container$$exitDocument$() {
  this.setHighlightedIndex(-1);
  this.openItem_ && this.openItem_.setOpen(!1);
  this.mouseButtonPressed_ = !1;
  goog.ui.Container.superClass_.exitDocument.call(this)
};
goog.ui.Container.prototype.disposeInternal = function $goog$ui$Container$$disposeInternal$() {
  goog.ui.Container.superClass_.disposeInternal.call(this);
  this.keyHandler_ && (this.keyHandler_.dispose(), this.keyHandler_ = null);
  this.renderer_ = this.openItem_ = this.childElementIdMap_ = this.keyEventTarget_ = null
};
goog.ui.Container.prototype.handleEnterItem = function $goog$ui$Container$$handleEnterItem$() {
  return!0
};
goog.ui.Container.prototype.handleHighlightItem = function $goog$ui$Container$$handleHighlightItem$(e) {
  var index = this.indexOfChild(e.target);
  if(-1 < index && index != this.highlightedIndex_) {
    var item = this.getHighlighted();
    item && item.setHighlighted(!1);
    this.highlightedIndex_ = index;
    item = this.getHighlighted();
    this.isMouseButtonPressed() && item.setActive(!0);
    this.openFollowsHighlight_ && this.openItem_ && item != this.openItem_ && (item.isSupportedState(goog.ui.Component.State.OPENED) ? item.setOpen(!0) : this.openItem_.setOpen(!1))
  }
  goog.dom.a11y.setState(this.getElement(), goog.dom.a11y.State.ACTIVEDESCENDANT, e.target.getElement().id)
};
goog.ui.Container.prototype.handleUnHighlightItem = function $goog$ui$Container$$handleUnHighlightItem$(e) {
  e.target == this.getHighlighted() && (this.highlightedIndex_ = -1);
  goog.dom.a11y.setState(this.getElement(), goog.dom.a11y.State.ACTIVEDESCENDANT, "")
};
goog.ui.Container.prototype.handleOpenItem = function $goog$ui$Container$$handleOpenItem$(e) {
  var item = e.target;
  item && item != this.openItem_ && item.getParent() == this && (this.openItem_ && this.openItem_.setOpen(!1), this.openItem_ = item)
};
goog.ui.Container.prototype.handleCloseItem = function $goog$ui$Container$$handleCloseItem$(e) {
  e.target == this.openItem_ && (this.openItem_ = null)
};
goog.ui.Container.prototype.handleMouseDown = function $goog$ui$Container$$handleMouseDown$(e) {
  this.enabled_ && this.setMouseButtonPressed(!0);
  var keyTarget = this.getKeyEventTarget();
  keyTarget && goog.dom.isFocusableTabIndex(keyTarget) ? keyTarget.focus() : e.preventDefault()
};
goog.ui.Container.prototype.handleDocumentMouseUp = function $goog$ui$Container$$handleDocumentMouseUp$() {
  this.setMouseButtonPressed(!1)
};
goog.ui.Container.prototype.handleChildMouseEvents = function $goog$ui$Container$$handleChildMouseEvents$(e) {
  var control = this.getOwnerControl(e.target);
  if(control) {
    switch(e.type) {
      case goog.events.EventType.MOUSEDOWN:
        control.handleMouseDown(e);
        break;
      case goog.events.EventType.MOUSEUP:
        control.handleMouseUp(e);
        break;
      case goog.events.EventType.MOUSEOVER:
        control.handleMouseOver(e);
        break;
      case goog.events.EventType.MOUSEOUT:
        control.handleMouseOut(e)
    }
  }
};
goog.ui.Container.prototype.getOwnerControl = function $goog$ui$Container$$getOwnerControl$(node) {
  if(this.childElementIdMap_) {
    for(var elem = this.getElement();node && node !== elem;) {
      var id = node.id;
      if(id in this.childElementIdMap_) {
        return this.childElementIdMap_[id]
      }
      node = node.parentNode
    }
  }
  return null
};
goog.ui.Container.prototype.handleFocus = function $goog$ui$Container$$handleFocus$() {
};
goog.ui.Container.prototype.handleBlur = function $goog$ui$Container$$handleBlur$() {
  this.setHighlightedIndex(-1);
  this.setMouseButtonPressed(!1);
  this.openItem_ && this.openItem_.setOpen(!1)
};
goog.ui.Container.prototype.handleKeyEvent = function $goog$ui$Container$$handleKeyEvent$(e) {
  return this.isEnabled() && this.isVisible() && (0 != this.getChildCount() || this.keyEventTarget_) && this.handleKeyEventInternal(e) ? (e.preventDefault(), e.stopPropagation(), !0) : !1
};
goog.ui.Container.prototype.handleKeyEventInternal = function $goog$ui$Container$$handleKeyEventInternal$(e) {
  var highlighted = this.getHighlighted();
  if(highlighted && "function" == typeof highlighted.handleKeyEvent && highlighted.handleKeyEvent(e) || this.openItem_ && this.openItem_ != highlighted && "function" == typeof this.openItem_.handleKeyEvent && this.openItem_.handleKeyEvent(e)) {
    return!0
  }
  if(e.shiftKey || e.ctrlKey || e.metaKey || e.altKey) {
    return!1
  }
  switch(e.keyCode) {
    case goog.events.KeyCodes.ESC:
      if(this.isFocusable()) {
        this.getKeyEventTarget().blur()
      }else {
        return!1
      }
      break;
    case goog.events.KeyCodes.HOME:
      this.highlightFirst();
      break;
    case goog.events.KeyCodes.END:
      this.highlightLast();
      break;
    case goog.events.KeyCodes.UP:
      if(this.orientation_ == goog.ui.Container.Orientation.VERTICAL) {
        this.highlightPrevious()
      }else {
        return!1
      }
      break;
    case goog.events.KeyCodes.LEFT:
      if(this.orientation_ == goog.ui.Container.Orientation.HORIZONTAL) {
        this.isRightToLeft() ? this.highlightNext() : this.highlightPrevious()
      }else {
        return!1
      }
      break;
    case goog.events.KeyCodes.DOWN:
      if(this.orientation_ == goog.ui.Container.Orientation.VERTICAL) {
        this.highlightNext()
      }else {
        return!1
      }
      break;
    case goog.events.KeyCodes.RIGHT:
      if(this.orientation_ == goog.ui.Container.Orientation.HORIZONTAL) {
        this.isRightToLeft() ? this.highlightPrevious() : this.highlightNext()
      }else {
        return!1
      }
      break;
    default:
      return!1
  }
  return!0
};
goog.ui.Container.prototype.registerChildId_ = function $goog$ui$Container$$registerChildId_$(child) {
  var childElem = child.getElement(), id = childElem.id || (childElem.id = child.getId());
  this.childElementIdMap_ || (this.childElementIdMap_ = {});
  this.childElementIdMap_[id] = child
};
goog.ui.Container.prototype.addChild = function $goog$ui$Container$$addChild$(child, opt_render) {
  goog.ui.Container.superClass_.addChild.call(this, child, opt_render)
};
goog.ui.Container.prototype.addChildAt = function $goog$ui$Container$$addChildAt$(control, index, opt_render) {
  control.setDispatchTransitionEvents(goog.ui.Component.State.HOVER, !0);
  control.setDispatchTransitionEvents(goog.ui.Component.State.OPENED, !0);
  (this.isFocusable() || !this.isFocusableChildrenAllowed()) && control.setSupportedState(goog.ui.Component.State.FOCUSED, !1);
  control.setHandleMouseEvents(!1);
  goog.ui.Container.superClass_.addChildAt.call(this, control, index, opt_render);
  control.isInDocument() && this.isInDocument() && this.registerChildId_(control);
  index <= this.highlightedIndex_ && this.highlightedIndex_++
};
goog.ui.Container.prototype.removeChild = function $goog$ui$Container$$removeChild$(control, opt_unrender) {
  if(control = goog.isString(control) ? this.getChild(control) : control) {
    var index = this.indexOfChild(control);
    -1 != index && (index == this.highlightedIndex_ ? control.setHighlighted(!1) : index < this.highlightedIndex_ && this.highlightedIndex_--);
    var childElem = control.getElement();
    childElem && childElem.id && this.childElementIdMap_ && goog.object.remove(this.childElementIdMap_, childElem.id)
  }
  control = goog.ui.Container.superClass_.removeChild.call(this, control, opt_unrender);
  control.setHandleMouseEvents(!0);
  return control
};
goog.ui.Container.prototype.getOrientation = function $goog$ui$Container$$getOrientation$() {
  return this.orientation_
};
goog.ui.Container.prototype.setOrientation = function $goog$ui$Container$$setOrientation$(orientation) {
  if(this.getElement()) {
    throw Error(goog.ui.Component.Error.ALREADY_RENDERED);
  }
  this.orientation_ = orientation
};
goog.ui.Container.prototype.isVisible = function $goog$ui$Container$$isVisible$() {
  return this.visible_
};
goog.ui.Container.prototype.setVisible = function $goog$ui$Container$$setVisible$(visible, opt_force) {
  if(opt_force || this.visible_ != visible && this.dispatchEvent(visible ? goog.ui.Component.EventType.SHOW : goog.ui.Component.EventType.HIDE)) {
    this.visible_ = visible;
    var elem = this.getElement();
    elem && (goog.style.showElement(elem, visible), this.isFocusable() && this.renderer_.enableTabIndex(this.getKeyEventTarget(), this.enabled_ && this.visible_), opt_force || this.dispatchEvent(this.visible_ ? goog.ui.Container.EventType.AFTER_SHOW : goog.ui.Container.EventType.AFTER_HIDE));
    return!0
  }
  return!1
};
goog.ui.Container.prototype.isEnabled = function $goog$ui$Container$$isEnabled$() {
  return this.enabled_
};
goog.ui.Container.prototype.setEnabled = function $goog$ui$Container$$setEnabled$(enable) {
  if(this.enabled_ != enable && this.dispatchEvent(enable ? goog.ui.Component.EventType.ENABLE : goog.ui.Component.EventType.DISABLE)) {
    enable ? (this.enabled_ = !0, this.forEachChild(function(child) {
      child.wasDisabled ? delete child.wasDisabled : child.setEnabled(!0)
    })) : (this.forEachChild(function(child) {
      child.isEnabled() ? child.setEnabled(!1) : child.wasDisabled = !0
    }), this.enabled_ = !1, this.setMouseButtonPressed(!1)), this.isFocusable() && this.renderer_.enableTabIndex(this.getKeyEventTarget(), enable && this.visible_)
  }
};
goog.ui.Container.prototype.isFocusable = function $goog$ui$Container$$isFocusable$() {
  return this.focusable_
};
goog.ui.Container.prototype.setFocusable = function $goog$ui$Container$$setFocusable$(focusable) {
  focusable != this.focusable_ && this.isInDocument() && this.enableFocusHandling_(focusable);
  this.focusable_ = focusable;
  this.enabled_ && this.visible_ && this.renderer_.enableTabIndex(this.getKeyEventTarget(), focusable)
};
goog.ui.Container.prototype.isFocusableChildrenAllowed = function $goog$ui$Container$$isFocusableChildrenAllowed$() {
  return this.allowFocusableChildren_
};
goog.ui.Container.prototype.setFocusableChildrenAllowed = function $goog$ui$Container$$setFocusableChildrenAllowed$(focusable) {
  this.allowFocusableChildren_ = focusable
};
goog.ui.Container.prototype.getHighlightedIndex = function $goog$ui$Container$$getHighlightedIndex$() {
  return this.highlightedIndex_
};
goog.ui.Container.prototype.setHighlightedIndex = function $goog$ui$Container$$setHighlightedIndex$(index) {
  var child = this.getChildAt(index);
  child ? child.setHighlighted(!0) : -1 < this.highlightedIndex_ && this.getHighlighted().setHighlighted(!1)
};
goog.ui.Container.prototype.setHighlighted = function $goog$ui$Container$$setHighlighted$(item) {
  this.setHighlightedIndex(this.indexOfChild(item))
};
goog.ui.Container.prototype.getHighlighted = function $goog$ui$Container$$getHighlighted$() {
  return this.getChildAt(this.highlightedIndex_)
};
goog.ui.Container.prototype.highlightFirst = function $goog$ui$Container$$highlightFirst$() {
  this.highlightHelper(function(index, max) {
    return(index + 1) % max
  }, this.getChildCount() - 1)
};
goog.ui.Container.prototype.highlightLast = function $goog$ui$Container$$highlightLast$() {
  this.highlightHelper(function(index, max) {
    index--;
    return 0 > index ? max - 1 : index
  }, 0)
};
goog.ui.Container.prototype.highlightNext = function $goog$ui$Container$$highlightNext$() {
  this.highlightHelper(function(index, max) {
    return(index + 1) % max
  }, this.highlightedIndex_)
};
goog.ui.Container.prototype.highlightPrevious = function $goog$ui$Container$$highlightPrevious$() {
  this.highlightHelper(function(index, max) {
    index--;
    return 0 > index ? max - 1 : index
  }, this.highlightedIndex_)
};
goog.ui.Container.prototype.highlightHelper = function $goog$ui$Container$$highlightHelper$(fn, startIndex) {
  for(var curIndex = 0 > startIndex ? this.indexOfChild(this.openItem_) : startIndex, numItems = this.getChildCount(), curIndex = fn.call(this, curIndex, numItems), visited = 0;visited <= numItems;) {
    var control = this.getChildAt(curIndex);
    if(control && this.canHighlightItem(control)) {
      return this.setHighlightedIndexFromKeyEvent(curIndex), !0
    }
    visited++;
    curIndex = fn.call(this, curIndex, numItems)
  }
  return!1
};
goog.ui.Container.prototype.canHighlightItem = function $goog$ui$Container$$canHighlightItem$(item) {
  return item.isVisible() && item.isEnabled() && item.isSupportedState(goog.ui.Component.State.HOVER)
};
goog.ui.Container.prototype.setHighlightedIndexFromKeyEvent = function $goog$ui$Container$$setHighlightedIndexFromKeyEvent$(index) {
  this.setHighlightedIndex(index)
};
goog.ui.Container.prototype.isMouseButtonPressed = function $goog$ui$Container$$isMouseButtonPressed$() {
  return this.mouseButtonPressed_
};
goog.ui.Container.prototype.setMouseButtonPressed = function $goog$ui$Container$$setMouseButtonPressed$(pressed) {
  this.mouseButtonPressed_ = pressed
};
goog.ui.MenuHeaderRenderer = function $goog$ui$MenuHeaderRenderer$() {
};
goog.inherits(goog.ui.MenuHeaderRenderer, goog.ui.ControlRenderer);
goog.addSingletonGetter(goog.ui.MenuHeaderRenderer);
goog.ui.MenuHeaderRenderer.CSS_CLASS = "ita-menuheader";
goog.ui.MenuHeaderRenderer.prototype.getCssClass = function $goog$ui$MenuHeaderRenderer$$getCssClass$() {
  return goog.ui.MenuHeaderRenderer.CSS_CLASS
};
goog.ui.MenuHeader = function $goog$ui$MenuHeader$(content, opt_domHelper, opt_renderer) {
  goog.ui.Control.call(this, content, opt_renderer || goog.ui.MenuHeaderRenderer.getInstance(), opt_domHelper);
  this.setSupportedState(goog.ui.Component.State.DISABLED, !1);
  this.setSupportedState(goog.ui.Component.State.HOVER, !1);
  this.setSupportedState(goog.ui.Component.State.ACTIVE, !1);
  this.setSupportedState(goog.ui.Component.State.FOCUSED, !1);
  this.setStateInternal(goog.ui.Component.State.DISABLED)
};
goog.inherits(goog.ui.MenuHeader, goog.ui.Control);
goog.ui.registry.setDecoratorByClassName(goog.ui.MenuHeaderRenderer.CSS_CLASS, function() {
  return new goog.ui.MenuHeader(null)
});
goog.ui.MenuItemRenderer = function $goog$ui$MenuItemRenderer$() {
  this.classNameCache_ = []
};
goog.inherits(goog.ui.MenuItemRenderer, goog.ui.ControlRenderer);
goog.addSingletonGetter(goog.ui.MenuItemRenderer);
goog.ui.MenuItemRenderer.CSS_CLASS = "ita-menuitem";
goog.ui.MenuItemRenderer.CompositeCssClassIndex_ = {HOVER:0, CHECKBOX:1, CONTENT:2};
goog.ui.MenuItemRenderer.prototype.getCompositeCssClass_ = function $goog$ui$MenuItemRenderer$$getCompositeCssClass_$(index) {
  var result = this.classNameCache_[index];
  if(!result) {
    switch(index) {
      case goog.ui.MenuItemRenderer.CompositeCssClassIndex_.HOVER:
        result = this.getStructuralCssClass() + "-highlight";
        break;
      case goog.ui.MenuItemRenderer.CompositeCssClassIndex_.CHECKBOX:
        result = this.getStructuralCssClass() + "-checkbox";
        break;
      case goog.ui.MenuItemRenderer.CompositeCssClassIndex_.CONTENT:
        result = this.getStructuralCssClass() + "-content"
    }
    this.classNameCache_[index] = result
  }
  return result
};
goog.ui.MenuItemRenderer.prototype.getAriaRole = function $goog$ui$MenuItemRenderer$$getAriaRole$() {
  return goog.dom.a11y.Role.MENU_ITEM
};
goog.ui.MenuItemRenderer.prototype.createDom = function $goog$ui$MenuItemRenderer$$createDom$(item) {
  var element = item.getDomHelper().createDom("div", this.getClassNames(item).join(" "), this.createContent(item.getContent(), item.getDomHelper()));
  this.setEnableCheckBoxStructure(item, element, item.isSupportedState(goog.ui.Component.State.SELECTED) || item.isSupportedState(goog.ui.Component.State.CHECKED));
  return element
};
goog.ui.MenuItemRenderer.prototype.getContentElement = function $goog$ui$MenuItemRenderer$$getContentElement$(element) {
  return element && element.firstChild
};
goog.ui.MenuItemRenderer.prototype.decorate = function $goog$ui$MenuItemRenderer$$decorate$(item, element) {
  this.hasContentStructure(element) || element.appendChild(this.createContent(element.childNodes, item.getDomHelper()));
  goog.dom.classes.has(element, "ita-option") && (item.setCheckable(!0), this.setCheckable(item, element, !0));
  return goog.ui.MenuItemRenderer.superClass_.decorate.call(this, item, element)
};
goog.ui.MenuItemRenderer.prototype.hasContentStructure = function $goog$ui$MenuItemRenderer$$hasContentStructure$(element) {
  var child = goog.dom.getFirstElementChild(element), contentClassName = this.getCompositeCssClass_(goog.ui.MenuItemRenderer.CompositeCssClassIndex_.CONTENT);
  return!!child && -1 != child.className.indexOf(contentClassName)
};
goog.ui.MenuItemRenderer.prototype.createContent = function $goog$ui$MenuItemRenderer$$createContent$(content, dom) {
  var contentClassName = this.getCompositeCssClass_(goog.ui.MenuItemRenderer.CompositeCssClassIndex_.CONTENT);
  return dom.createDom("div", contentClassName, content)
};
goog.ui.MenuItemRenderer.prototype.setCheckable = function $goog$ui$MenuItemRenderer$$setCheckable$(item, element, checkable) {
  element && (goog.dom.a11y.setRole(element, checkable ? goog.dom.a11y.Role.MENU_ITEM_CHECKBOX : this.getAriaRole()), this.setEnableCheckBoxStructure(item, element, checkable))
};
goog.ui.MenuItemRenderer.prototype.hasCheckBoxStructure = function $goog$ui$MenuItemRenderer$$hasCheckBoxStructure$(element) {
  var contentElement = this.getContentElement(element);
  if(contentElement) {
    var child = contentElement.firstChild, checkboxClassName = this.getCompositeCssClass_(goog.ui.MenuItemRenderer.CompositeCssClassIndex_.CHECKBOX);
    return!!child && !!child.className && -1 != child.className.indexOf(checkboxClassName)
  }
  return!1
};
goog.ui.MenuItemRenderer.prototype.setEnableCheckBoxStructure = function $goog$ui$MenuItemRenderer$$setEnableCheckBoxStructure$(item, element, enable) {
  if(enable != this.hasCheckBoxStructure(element)) {
    goog.dom.classes.enable(element, "ita-option", enable);
    var contentElement = this.getContentElement(element);
    if(enable) {
      var checkboxClassName = this.getCompositeCssClass_(goog.ui.MenuItemRenderer.CompositeCssClassIndex_.CHECKBOX);
      contentElement.insertBefore(item.getDomHelper().createDom("div", checkboxClassName), contentElement.firstChild || null)
    }else {
      contentElement.removeChild(contentElement.firstChild)
    }
  }
};
goog.ui.MenuItemRenderer.prototype.getClassForState = function $goog$ui$MenuItemRenderer$$getClassForState$(state) {
  switch(state) {
    case goog.ui.Component.State.HOVER:
      return this.getCompositeCssClass_(goog.ui.MenuItemRenderer.CompositeCssClassIndex_.HOVER);
    case goog.ui.Component.State.CHECKED:
    ;
    case goog.ui.Component.State.SELECTED:
      return"ita-option-selected";
    default:
      return goog.ui.MenuItemRenderer.superClass_.getClassForState.call(this, state)
  }
};
goog.ui.MenuItemRenderer.prototype.getStateFromClass = function $goog$ui$MenuItemRenderer$$getStateFromClass$(className) {
  var hoverClassName = this.getCompositeCssClass_(goog.ui.MenuItemRenderer.CompositeCssClassIndex_.HOVER);
  switch(className) {
    case "ita-option-selected":
      return goog.ui.Component.State.CHECKED;
    case hoverClassName:
      return goog.ui.Component.State.HOVER;
    default:
      return goog.ui.MenuItemRenderer.superClass_.getStateFromClass.call(this, className)
  }
};
goog.ui.MenuItemRenderer.prototype.getCssClass = function $goog$ui$MenuItemRenderer$$getCssClass$() {
  return goog.ui.MenuItemRenderer.CSS_CLASS
};
goog.ui.MenuItem = function $goog$ui$MenuItem$(content, opt_model, opt_domHelper, opt_renderer) {
  goog.ui.Control.call(this, content, opt_renderer || goog.ui.MenuItemRenderer.getInstance(), opt_domHelper);
  this.setValue(opt_model)
};
goog.inherits(goog.ui.MenuItem, goog.ui.Control);
goog.ui.MenuItem.MNEMONIC_WRAPPER_CLASS_ = "ita-menuitem-mnemonic-separator";
goog.ui.MenuItem.ACCELERATOR_CLASS_ = "ita-menuitem-accel";
goog.ui.MenuItem.prototype.getValue = function $goog$ui$MenuItem$$getValue$() {
  var model = this.getModel();
  return null != model ? model : this.getCaption()
};
goog.ui.MenuItem.prototype.setValue = function $goog$ui$MenuItem$$setValue$(value) {
  this.setModel(value)
};
goog.ui.MenuItem.prototype.setCheckable = function $goog$ui$MenuItem$$setCheckable$(checkable) {
  this.setSupportedState(goog.ui.Component.State.CHECKED, checkable);
  var element = this.getElement();
  element && this.getRenderer().setCheckable(this, element, checkable)
};
goog.ui.MenuItem.prototype.getCaption = function $goog$ui$MenuItem$$getCaption$() {
  var content = this.getContent();
  if(goog.isArray(content)) {
    var acceleratorClass = goog.ui.MenuItem.ACCELERATOR_CLASS_, mnemonicWrapClass = goog.ui.MenuItem.MNEMONIC_WRAPPER_CLASS_, caption = goog.array.map(content, function(node) {
      var classes = goog.dom.classes.get(node);
      return goog.array.contains(classes, acceleratorClass) || goog.array.contains(classes, mnemonicWrapClass) ? "" : goog.dom.getRawTextContent(node)
    }).join("");
    return goog.string.collapseBreakingSpaces(caption)
  }
  return goog.ui.MenuItem.superClass_.getCaption.call(this)
};
goog.ui.MenuItem.prototype.handleMouseUp = function $goog$ui$MenuItem$$handleMouseUp$(e) {
  var parentMenu = this.getParent();
  if(parentMenu) {
    var oldCoords = parentMenu.openingCoords;
    parentMenu.openingCoords = null;
    if(oldCoords && goog.isNumber(e.clientX)) {
      var newCoords = new goog.math.Coordinate(e.clientX, e.clientY);
      if(goog.math.Coordinate.equals(oldCoords, newCoords)) {
        return
      }
    }
  }
  goog.ui.MenuItem.superClass_.handleMouseUp.call(this, e)
};
goog.ui.MenuItem.prototype.handleKeyEventInternal = function $goog$ui$MenuItem$$handleKeyEventInternal$(e) {
  return e.keyCode == this.getMnemonic() && this.performActionInternal(e) ? !0 : goog.ui.MenuItem.superClass_.handleKeyEventInternal.call(this, e)
};
goog.ui.MenuItem.prototype.getMnemonic = function $goog$ui$MenuItem$$getMnemonic$() {
  return this.mnemonicKey_
};
goog.ui.registry.setDecoratorByClassName(goog.ui.MenuItemRenderer.CSS_CLASS, function() {
  return new goog.ui.MenuItem(null)
});
goog.ui.MenuRenderer = function $goog$ui$MenuRenderer$() {
};
goog.inherits(goog.ui.MenuRenderer, goog.ui.ContainerRenderer);
goog.addSingletonGetter(goog.ui.MenuRenderer);
goog.ui.MenuRenderer.CSS_CLASS = "ita-menu";
goog.ui.MenuRenderer.prototype.getAriaRole = function $goog$ui$MenuRenderer$$getAriaRole$() {
  return goog.dom.a11y.Role.MENU
};
goog.ui.MenuRenderer.prototype.canDecorate = function $goog$ui$MenuRenderer$$canDecorate$(element) {
  return"UL" == element.tagName || goog.ui.MenuRenderer.superClass_.canDecorate.call(this, element)
};
goog.ui.MenuRenderer.prototype.getDecoratorForChild = function $goog$ui$MenuRenderer$$getDecoratorForChild$(element) {
  return"HR" == element.tagName ? new goog.ui.Separator : goog.ui.MenuRenderer.superClass_.getDecoratorForChild.call(this, element)
};
goog.ui.MenuRenderer.prototype.containsElement = function $goog$ui$MenuRenderer$$containsElement$(menu, element) {
  return goog.dom.contains(menu.getElement(), element)
};
goog.ui.MenuRenderer.prototype.getCssClass = function $goog$ui$MenuRenderer$$getCssClass$() {
  return goog.ui.MenuRenderer.CSS_CLASS
};
goog.ui.MenuRenderer.prototype.initializeDom = function $goog$ui$MenuRenderer$$initializeDom$(container) {
  goog.ui.MenuRenderer.superClass_.initializeDom.call(this, container);
  var element = container.getElement();
  goog.dom.a11y.setState(element, goog.dom.a11y.State.HASPOPUP, "true")
};
goog.ui.MenuSeparator = function $goog$ui$MenuSeparator$(opt_domHelper) {
  goog.ui.Separator.call(this, goog.ui.MenuSeparatorRenderer.getInstance(), opt_domHelper)
};
goog.inherits(goog.ui.MenuSeparator, goog.ui.Separator);
goog.ui.registry.setDecoratorByClassName(goog.ui.MenuSeparatorRenderer.CSS_CLASS, function() {
  return new goog.ui.Separator
});
goog.ui.Menu = function $goog$ui$Menu$(opt_domHelper, opt_renderer) {
  goog.ui.Container.call(this, goog.ui.Container.Orientation.VERTICAL, opt_renderer || goog.ui.MenuRenderer.getInstance(), opt_domHelper);
  this.setFocusable(!1)
};
goog.inherits(goog.ui.Menu, goog.ui.Container);
goog.ui.Menu.EventType = {BEFORE_SHOW:goog.ui.Component.EventType.BEFORE_SHOW, SHOW:goog.ui.Component.EventType.SHOW, BEFORE_HIDE:goog.ui.Component.EventType.HIDE, HIDE:goog.ui.Component.EventType.HIDE};
goog.ui.Menu.CSS_CLASS = goog.ui.MenuRenderer.CSS_CLASS;
goog.ui.Menu.prototype.allowAutoFocus_ = !0;
goog.ui.Menu.prototype.allowHighlightDisabled_ = !1;
goog.ui.Menu.prototype.getCssClass = function $goog$ui$Menu$$getCssClass$() {
  return this.getRenderer().getCssClass()
};
goog.ui.Menu.prototype.containsElement = function $goog$ui$Menu$$containsElement$(element) {
  if(this.getRenderer().containsElement(this, element)) {
    return!0
  }
  for(var i = 0, count = this.getChildCount();i < count;i++) {
    var child = this.getChildAt(i);
    if("function" == typeof child.containsElement && child.containsElement(element)) {
      return!0
    }
  }
  return!1
};
goog.ui.Menu.prototype.setPosition = function $goog$ui$Menu$$setPosition$(x, opt_y) {
  var visible = this.isVisible();
  visible || goog.style.showElement(this.getElement(), !0);
  goog.style.setPageOffset(this.getElement(), x, opt_y);
  visible || goog.style.showElement(this.getElement(), !1)
};
goog.ui.Menu.prototype.getPosition = function $goog$ui$Menu$$getPosition$() {
  return this.isVisible() ? goog.style.getPageOffset(this.getElement()) : null
};
goog.ui.Menu.prototype.setAllowAutoFocus = function $goog$ui$Menu$$setAllowAutoFocus$(allow) {
  (this.allowAutoFocus_ = allow) && this.setFocusable(!0)
};
goog.ui.Menu.prototype.setVisible = function $goog$ui$Menu$$setVisible$(show, opt_force, opt_e) {
  var visibilityChanged = goog.ui.Menu.superClass_.setVisible.call(this, show, opt_force);
  visibilityChanged && show && this.isInDocument() && this.allowAutoFocus_ && this.getKeyEventTarget().focus();
  this.openingCoords = show && opt_e && goog.isNumber(opt_e.clientX) ? new goog.math.Coordinate(opt_e.clientX, opt_e.clientY) : null;
  return visibilityChanged
};
goog.ui.Menu.prototype.handleEnterItem = function $goog$ui$Menu$$handleEnterItem$(e) {
  this.allowAutoFocus_ && this.getKeyEventTarget().focus();
  return goog.ui.Menu.superClass_.handleEnterItem.call(this, e)
};
goog.ui.Menu.prototype.canHighlightItem = function $goog$ui$Menu$$canHighlightItem$(item) {
  return(this.allowHighlightDisabled_ || item.isEnabled()) && item.isVisible() && item.isSupportedState(goog.ui.Component.State.HOVER)
};
goog.ui.Menu.prototype.decorateInternal = function $goog$ui$Menu$$decorateInternal$(element) {
  this.decorateContent(element);
  goog.ui.Menu.superClass_.decorateInternal.call(this, element)
};
goog.ui.Menu.prototype.handleKeyEventInternal = function $goog$ui$Menu$$handleKeyEventInternal$(e) {
  var handled = goog.ui.Menu.superClass_.handleKeyEventInternal.call(this, e);
  handled || this.forEachChild(function(menuItem) {
    !handled && menuItem.getMnemonic && menuItem.getMnemonic() == e.keyCode && (this.isEnabled() && this.setHighlighted(menuItem), handled = menuItem.handleKeyEvent(e))
  }, this);
  return handled
};
goog.ui.Menu.prototype.decorateContent = function $goog$ui$Menu$$decorateContent$(element) {
  for(var renderer = this.getRenderer(), contentElements = this.getDomHelper().getElementsByTagNameAndClass("div", renderer.getCssClass() + "-content", element), length = contentElements.length, i = 0;i < length;i++) {
    renderer.decorateChildren(this, contentElements[i])
  }
};
goog.fx.Transition = function $goog$fx$Transition$() {
};
goog.fx.Transition.EventType = {PLAY:"play", BEGIN:"begin", RESUME:"resume", END:"end", STOP:"stop", FINISH:"finish", PAUSE:"pause"};
goog.ui.PopupBase = function $goog$ui$PopupBase$(opt_element, opt_type) {
  goog.events.EventTarget.call(this);
  this.handler_ = new goog.events.EventHandler(this);
  this.setElement(opt_element || null);
  opt_type && this.setType(opt_type)
};
goog.inherits(goog.ui.PopupBase, goog.events.EventTarget);
goog.ui.PopupBase.Type = {TOGGLE_DISPLAY:"toggle_display", MOVE_OFFSCREEN:"move_offscreen"};
goog.ui.PopupBase.prototype.element_ = null;
goog.ui.PopupBase.prototype.autoHide_ = !0;
goog.ui.PopupBase.prototype.autoHideRegion_ = null;
goog.ui.PopupBase.prototype.isVisible_ = !1;
goog.ui.PopupBase.prototype.shouldHideAsync_ = !1;
goog.ui.PopupBase.prototype.lastShowTime_ = -1;
goog.ui.PopupBase.prototype.lastHideTime_ = -1;
goog.ui.PopupBase.prototype.hideOnEscape_ = !1;
goog.ui.PopupBase.prototype.enableCrossIframeDismissal_ = !0;
goog.ui.PopupBase.prototype.type_ = goog.ui.PopupBase.Type.TOGGLE_DISPLAY;
goog.ui.PopupBase.EventType = {BEFORE_SHOW:"beforeshow", SHOW:"show", BEFORE_HIDE:"beforehide", HIDE:"hide"};
goog.ui.PopupBase.DEBOUNCE_DELAY_MS = 150;
goog.ui.PopupBase.prototype.getType = function $goog$ui$PopupBase$$getType$() {
  return this.type_
};
goog.ui.PopupBase.prototype.setType = function $goog$ui$PopupBase$$setType$(type) {
  this.type_ = type
};
goog.ui.PopupBase.prototype.getElement = function $goog$ui$PopupBase$$getElement$() {
  return this.element_
};
goog.ui.PopupBase.prototype.setElement = function $goog$ui$PopupBase$$setElement$(elt) {
  this.ensureNotVisible_();
  this.element_ = elt
};
goog.ui.PopupBase.prototype.ensureNotVisible_ = function $goog$ui$PopupBase$$ensureNotVisible_$() {
  if(this.isVisible_) {
    throw Error("Can not change this state of the popup while showing.");
  }
};
goog.ui.PopupBase.prototype.isVisible = function $goog$ui$PopupBase$$isVisible$() {
  return this.isVisible_
};
goog.ui.PopupBase.prototype.isOrWasRecentlyVisible = function $goog$ui$PopupBase$$isOrWasRecentlyVisible$() {
  return this.isVisible_ || goog.now() - this.lastHideTime_ < goog.ui.PopupBase.DEBOUNCE_DELAY_MS
};
goog.ui.PopupBase.prototype.setVisible = function $goog$ui$PopupBase$$setVisible$(visible) {
  this.showTransition_ && this.showTransition_.stop();
  this.hideTransition_ && this.hideTransition_.stop();
  visible ? this.show_() : this.hide_()
};
goog.ui.PopupBase.prototype.reposition = goog.nullFunction;
goog.ui.PopupBase.prototype.show_ = function $goog$ui$PopupBase$$show_$() {
  if(!this.isVisible_ && this.onBeforeShow()) {
    if(!this.element_) {
      throw Error("Caller must call setElement before trying to show the popup");
    }
    this.reposition();
    var doc = goog.dom.getOwnerDocument(this.element_);
    this.hideOnEscape_ && this.handler_.listen(doc, goog.events.EventType.KEYDOWN, this.onDocumentKeyDown_, !0);
    if(this.autoHide_) {
      if(this.handler_.listen(doc, goog.events.EventType.MOUSEDOWN, this.onDocumentMouseDown_, !0), goog.userAgent.IE) {
        var activeElement;
        try {
          activeElement = doc.activeElement
        }catch(e) {
        }
        for(;activeElement && "IFRAME" == activeElement.nodeName;) {
          try {
            var tempDoc = goog.dom.getFrameContentDocument(activeElement)
          }catch(e$$0) {
            break
          }
          doc = tempDoc;
          activeElement = doc.activeElement
        }
        this.handler_.listen(doc, goog.events.EventType.MOUSEDOWN, this.onDocumentMouseDown_, !0);
        this.handler_.listen(doc, goog.events.EventType.DEACTIVATE, this.onDocumentBlur_)
      }else {
        this.handler_.listen(doc, goog.events.EventType.BLUR, this.onDocumentBlur_)
      }
    }
    this.type_ == goog.ui.PopupBase.Type.TOGGLE_DISPLAY ? this.showPopupElement() : this.type_ == goog.ui.PopupBase.Type.MOVE_OFFSCREEN && this.reposition();
    this.isVisible_ = !0;
    if(this.showTransition_) {
      goog.events.listenOnce(this.showTransition_, goog.fx.Transition.EventType.END, this.onShow_, !1, this), this.showTransition_.play()
    }else {
      this.onShow_()
    }
  }
};
goog.ui.PopupBase.prototype.hide_ = function $goog$ui$PopupBase$$hide_$(opt_target) {
  if(!this.isVisible_ || !this.onBeforeHide_(opt_target)) {
    return!1
  }
  this.handler_ && this.handler_.removeAll();
  this.isVisible_ = !1;
  this.hideTransition_ ? (goog.events.listenOnce(this.hideTransition_, goog.fx.Transition.EventType.END, goog.partial(this.continueHidingPopup_, opt_target), !1, this), this.hideTransition_.play()) : this.continueHidingPopup_(opt_target);
  return!0
};
goog.ui.PopupBase.prototype.continueHidingPopup_ = function $goog$ui$PopupBase$$continueHidingPopup_$(opt_target) {
  this.type_ == goog.ui.PopupBase.Type.TOGGLE_DISPLAY ? this.shouldHideAsync_ ? goog.Timer.callOnce(this.hidePopupElement_, 0, this) : this.hidePopupElement_() : this.type_ == goog.ui.PopupBase.Type.MOVE_OFFSCREEN && this.moveOffscreen_();
  this.onHide_(opt_target)
};
goog.ui.PopupBase.prototype.showPopupElement = function $goog$ui$PopupBase$$showPopupElement$() {
  this.element_.style.visibility = "visible";
  goog.style.showElement(this.element_, !0)
};
goog.ui.PopupBase.prototype.hidePopupElement_ = function $goog$ui$PopupBase$$hidePopupElement_$() {
  this.element_.style.visibility = "hidden";
  goog.style.showElement(this.element_, !1)
};
goog.ui.PopupBase.prototype.moveOffscreen_ = function $goog$ui$PopupBase$$moveOffscreen_$() {
  this.element_.style.left = "-200px";
  this.element_.style.top = "-200px"
};
goog.ui.PopupBase.prototype.onBeforeShow = function $goog$ui$PopupBase$$onBeforeShow$() {
  return this.dispatchEvent(goog.ui.PopupBase.EventType.BEFORE_SHOW)
};
goog.ui.PopupBase.prototype.onShow_ = function $goog$ui$PopupBase$$onShow_$() {
  this.lastShowTime_ = goog.now();
  this.lastHideTime_ = -1;
  this.dispatchEvent(goog.ui.PopupBase.EventType.SHOW)
};
goog.ui.PopupBase.prototype.onBeforeHide_ = function $goog$ui$PopupBase$$onBeforeHide_$(opt_target) {
  return this.dispatchEvent({type:goog.ui.PopupBase.EventType.BEFORE_HIDE, target:opt_target})
};
goog.ui.PopupBase.prototype.onHide_ = function $goog$ui$PopupBase$$onHide_$(opt_target) {
  this.lastHideTime_ = goog.now();
  this.dispatchEvent({type:goog.ui.PopupBase.EventType.HIDE, target:opt_target})
};
goog.ui.PopupBase.prototype.onDocumentMouseDown_ = function $goog$ui$PopupBase$$onDocumentMouseDown_$(e) {
  var target = e.target;
  !goog.dom.contains(this.element_, target) && (!this.autoHideRegion_ || goog.dom.contains(this.autoHideRegion_, target)) && !this.shouldDebounce_() && this.hide_(target)
};
goog.ui.PopupBase.prototype.onDocumentKeyDown_ = function $goog$ui$PopupBase$$onDocumentKeyDown_$(e) {
  e.keyCode == goog.events.KeyCodes.ESC && this.hide_(e.target) && (e.preventDefault(), e.stopPropagation())
};
goog.ui.PopupBase.prototype.onDocumentBlur_ = function $goog$ui$PopupBase$$onDocumentBlur_$(e) {
  if(this.enableCrossIframeDismissal_) {
    var doc = goog.dom.getOwnerDocument(this.element_);
    if(goog.userAgent.IE || goog.userAgent.OPERA) {
      var activeElement = doc.activeElement;
      if(!activeElement || goog.dom.contains(this.element_, activeElement) || "BODY" == activeElement.tagName) {
        return
      }
    }else {
      if(e.target != doc) {
        return
      }
    }
    this.shouldDebounce_() || this.hide_()
  }
};
goog.ui.PopupBase.prototype.shouldDebounce_ = function $goog$ui$PopupBase$$shouldDebounce_$() {
  return goog.now() - this.lastShowTime_ < goog.ui.PopupBase.DEBOUNCE_DELAY_MS
};
goog.ui.PopupBase.prototype.disposeInternal = function $goog$ui$PopupBase$$disposeInternal$() {
  goog.ui.PopupBase.superClass_.disposeInternal.call(this);
  this.handler_.dispose();
  goog.dispose(this.showTransition_);
  goog.dispose(this.hideTransition_);
  delete this.element_;
  delete this.handler_
};
goog.ui.PopupMenu = function $goog$ui$PopupMenu$(opt_domHelper, opt_renderer) {
  goog.ui.Menu.call(this, opt_domHelper, opt_renderer);
  this.setAllowAutoFocus(!0);
  this.setVisible(!1, !0);
  this.targets_ = new goog.structs.Map
};
goog.inherits(goog.ui.PopupMenu, goog.ui.Menu);
goog.ui.PopupMenu.prototype.toggleMode_ = !1;
goog.ui.PopupMenu.prototype.lastHide_ = 0;
goog.ui.PopupMenu.prototype.decorateInternal = function $goog$ui$PopupMenu$$decorateInternal$(element) {
  goog.ui.PopupMenu.superClass_.decorateInternal.call(this, element);
  var htmlFor = element.getAttribute("for") || element.htmlFor;
  htmlFor && this.attach(this.getDomHelper().getElement(htmlFor), goog.positioning.Corner.BOTTOM_LEFT)
};
goog.ui.PopupMenu.prototype.enterDocument = function $goog$ui$PopupMenu$$enterDocument$() {
  goog.ui.PopupMenu.superClass_.enterDocument.call(this);
  goog.structs.forEach(this.targets_, this.attachEvent_, this);
  var handler = this.getHandler();
  handler.listen(this, goog.ui.Component.EventType.ACTION, this.onAction_);
  handler.listen(this.getDomHelper().getDocument(), goog.events.EventType.MOUSEDOWN, this.onDocClick, !0);
  goog.userAgent.WEBKIT && handler.listen(this.getDomHelper().getDocument(), goog.events.EventType.CONTEXTMENU, this.onDocClick, !0)
};
goog.ui.PopupMenu.prototype.attach = function $goog$ui$PopupMenu$$attach$(element, opt_targetCorner, opt_menuCorner, opt_contextMenu, opt_margin) {
  if(!this.isAttachTarget(element)) {
    var target = this.createAttachTarget(element, opt_targetCorner, opt_menuCorner, opt_contextMenu, opt_margin);
    this.isInDocument() && this.attachEvent_(target)
  }
};
goog.ui.PopupMenu.prototype.createAttachTarget = function $goog$ui$PopupMenu$$createAttachTarget$(element, opt_targetCorner, opt_menuCorner, opt_contextMenu, opt_margin) {
  if(!element) {
    return null
  }
  var target = {element_:element, targetCorner_:opt_targetCorner, menuCorner_:opt_menuCorner, eventType_:opt_contextMenu ? goog.events.EventType.CONTEXTMENU : goog.events.EventType.MOUSEDOWN, margin_:opt_margin};
  this.targets_.set(goog.getUid(element), target);
  return target
};
goog.ui.PopupMenu.prototype.isAttachTarget = function $goog$ui$PopupMenu$$isAttachTarget$(element) {
  return element ? this.targets_.containsKey(goog.getUid(element)) : !1
};
goog.ui.PopupMenu.prototype.attachEvent_ = function $goog$ui$PopupMenu$$attachEvent_$(target) {
  this.getHandler().listen(target.element_, target.eventType_, this.onTargetClick_)
};
goog.ui.PopupMenu.prototype.detach = function $goog$ui$PopupMenu$$detach$(element) {
  if(!this.isAttachTarget(element)) {
    throw Error("Menu not attached to provided element, unable to detach.");
  }
  var key = goog.getUid(element);
  this.isInDocument() && this.detachEvent_(this.targets_.get(key));
  this.targets_.remove(key)
};
goog.ui.PopupMenu.prototype.detachEvent_ = function $goog$ui$PopupMenu$$detachEvent_$(target) {
  this.getHandler().unlisten(target.element_, target.eventType_, this.onTargetClick_)
};
goog.ui.PopupMenu.prototype.showWithPosition = function $goog$ui$PopupMenu$$showWithPosition$(position, opt_menuCorner, opt_margin) {
  var isVisible = this.isVisible();
  if(this.isOrWasRecentlyVisible() && this.toggleMode_) {
    this.hide()
  }else {
    if(this.dispatchEvent(goog.ui.Component.EventType.BEFORE_SHOW)) {
      var menuCorner = "undefined" != typeof opt_menuCorner ? opt_menuCorner : goog.positioning.Corner.TOP_START;
      isVisible || (this.getElement().style.visibility = "hidden");
      goog.style.showElement(this.getElement(), !0);
      position.reposition(this.getElement(), menuCorner, opt_margin);
      isVisible || (this.getElement().style.visibility = "visible");
      this.setHighlightedIndex(-1);
      this.setVisible(!0)
    }
  }
};
goog.ui.PopupMenu.prototype.showMenu = function $goog$ui$PopupMenu$$showMenu$(target, x, y) {
  var position = goog.isDef(target.targetCorner_) ? new goog.positioning.AnchoredViewportPosition(target.element_, target.targetCorner_, !0) : new goog.positioning.ViewportClientPosition(x, y);
  position.setLastResortOverflow && position.setLastResortOverflow(goog.positioning.Overflow.ADJUST_X | goog.positioning.Overflow.ADJUST_Y);
  this.showWithPosition(position, target.menuCorner_, target.margin_, target.element_)
};
goog.ui.PopupMenu.prototype.hide = function $goog$ui$PopupMenu$$hide$() {
  this.isVisible() && (this.setVisible(!1), this.isVisible() || (this.lastHide_ = goog.now()))
};
goog.ui.PopupMenu.prototype.isOrWasRecentlyVisible = function $goog$ui$PopupMenu$$isOrWasRecentlyVisible$() {
  return this.isVisible() || this.wasRecentlyHidden()
};
goog.ui.PopupMenu.prototype.wasRecentlyHidden = function $goog$ui$PopupMenu$$wasRecentlyHidden$() {
  return goog.now() - this.lastHide_ < goog.ui.PopupBase.DEBOUNCE_DELAY_MS
};
goog.ui.PopupMenu.prototype.onAction_ = function $goog$ui$PopupMenu$$onAction_$() {
  this.hide()
};
goog.ui.PopupMenu.prototype.onTargetClick_ = function $goog$ui$PopupMenu$$onTargetClick_$(e) {
  for(var keys = this.targets_.getKeys(), i = 0;i < keys.length;i++) {
    var target = this.targets_.get(keys[i]);
    if(target.element_ == e.currentTarget) {
      this.showMenu(target, e.clientX, e.clientY);
      e.preventDefault();
      e.stopPropagation();
      break
    }
  }
};
goog.ui.PopupMenu.prototype.onDocClick = function $goog$ui$PopupMenu$$onDocClick$(e) {
  this.isVisible() && !this.containsElement(e.target) && this.hide()
};
goog.ui.PopupMenu.prototype.handleBlur = function $goog$ui$PopupMenu$$handleBlur$(e) {
  goog.ui.PopupMenu.superClass_.handleBlur.call(this, e);
  this.hide()
};
goog.ui.PopupMenu.prototype.disposeInternal = function $goog$ui$PopupMenu$$disposeInternal$() {
  goog.ui.PopupMenu.superClass_.disposeInternal.call(this);
  this.targets_ && (this.targets_.clear(), delete this.targets_)
};
goog.ime.ui.CustomMenuItem = function $goog$ime$ui$CustomMenuItem$(content, opt_model, opt_domHelper, opt_renderer, opt_isActionKey) {
  goog.ui.MenuItem.call(this, content, opt_model, opt_domHelper, opt_renderer);
  this.isActionKey_ = opt_isActionKey || goog.ime.ui.CustomMenuItem.isSpaceOrEnter_
};
goog.inherits(goog.ime.ui.CustomMenuItem, goog.ui.MenuItem);
goog.ime.ui.CustomMenuItem.isSpaceOrEnter_ = function $goog$ime$ui$CustomMenuItem$isSpaceOrEnter_$(e) {
  return e.keyCode == goog.events.KeyCodes.SPACE || e.keyCode == goog.events.KeyCodes.ENTER
};
goog.ime.ui.CustomMenuItem.prototype.setActionKeyFn = function $goog$ime$ui$CustomMenuItem$$setActionKeyFn$(isActionKeyFn) {
  this.isActionKey_ = isActionKeyFn
};
goog.ime.ui.CustomMenuItem.prototype.handleKeyEventInternal = function $goog$ime$ui$CustomMenuItem$$handleKeyEventInternal$(e) {
  var isActionKey = this.isActionKey_(e);
  return isActionKey && this.dispatchEvent({type:goog.ui.Component.EventType.ACTION, originalEvent:e})
};
goog.ime.ui.CustomPopupMenu = function $goog$ime$ui$CustomPopupMenu$(dom, opt_renderer, opt_hideKeys) {
  goog.ui.PopupMenu.call(this, dom, opt_renderer);
  this.hideKeys_ = opt_hideKeys || [goog.events.KeyCodes.BACKSPACE, goog.events.KeyCodes.ESC]
};
goog.inherits(goog.ime.ui.CustomPopupMenu, goog.ui.PopupMenu);
goog.ime.ui.CustomPopupMenu.prototype.logger = goog.debug.Logger.getLogger("goog.ime.ui.CustomPopupMenu");
goog.ime.ui.CustomPopupMenu.prototype.setMenuItemRenderer = function $goog$ime$ui$CustomPopupMenu$$setMenuItemRenderer$(renderer) {
  this.defaultMenuItemRenderer = renderer
};
goog.ime.ui.CustomPopupMenu.prototype.setActionKeyFn = function $goog$ime$ui$CustomPopupMenu$$setActionKeyFn$(isActionKeyFn) {
  this.isActionKeyFn = isActionKeyFn
};
goog.ime.ui.CustomPopupMenu.prototype.setCallback = function $goog$ime$ui$CustomPopupMenu$$setCallback$(callback) {
  this.callbackFunction_ = callback
};
goog.ime.ui.CustomPopupMenu.prototype.addMenuItem = function $goog$ime$ui$CustomPopupMenu$$addMenuItem$(displayContent, model, opt_renderer, opt_style) {
  var mItem = new goog.ime.ui.CustomMenuItem(displayContent, model, this.getDomHelper(), opt_renderer || this.defaultMenuItemRenderer, this.isActionKeyFn);
  this.addChild(mItem, !0);
  opt_style && goog.style.setStyle(mItem.getElement(), opt_style);
  return mItem
};
goog.ime.ui.CustomPopupMenu.prototype.createDom = function $goog$ime$ui$CustomPopupMenu$$createDom$() {
  goog.ime.ui.CustomPopupMenu.superClass_.createDom.call(this);
  this.setAllowAutoFocus(!1)
};
goog.ime.ui.CustomPopupMenu.prototype.enterDocument = function $goog$ime$ui$CustomPopupMenu$$enterDocument$() {
  goog.ime.ui.CustomPopupMenu.superClass_.enterDocument.call(this);
  goog.array.forEach(goog.dom.getElementsByTagNameAndClass("iframe"), function(iframe) {
    try {
      var frameDoc = goog.dom.getFrameContentDocument(iframe);
      goog.events.listen(frameDoc, goog.events.EventType.MOUSEDOWN, this.onDocClick, !0, this);
      goog.userAgent.WEBKIT && goog.events.listen(frameDoc, goog.events.EventType.CONTEXTMENU, this.onDocClick, !0, this)
    }catch(e) {
    }
  }, this);
  this.addEventListener(goog.ui.Component.EventType.ACTION, this.handleMenuEvent_, !1, this)
};
goog.ime.ui.CustomPopupMenu.prototype.handleKeyEventInternal = function $goog$ime$ui$CustomPopupMenu$$handleKeyEventInternal$(e) {
  return goog.array.contains(this.hideKeys_, e.keyCode) && this.isFocusable() ? (this.hide(), this.dispatchEvent(goog.ui.Component.EventType.BLUR), this.callbackFunction_ && (this.callbackFunction_(!1, ""), this.callbackFunction_ = null), !0) : goog.ime.ui.CustomPopupMenu.superClass_.handleKeyEventInternal.call(this, e) || this.ignoreEvent(e)
};
goog.ime.ui.CustomPopupMenu.prototype.ignoreEvent = function $goog$ime$ui$CustomPopupMenu$$ignoreEvent$(e) {
  return goog.events.KeyCodes.isTextModifyingKeyEvent(e)
};
goog.ime.ui.CustomPopupMenu.prototype.handleMenuEvent_ = function $goog$ime$ui$CustomPopupMenu$$handleMenuEvent_$(e) {
  this.logger.info("menu event:" + e.type);
  var model = e.target.getModel() || null, itemSelected = null != model;
  this.callbackFunction_ && (this.callbackFunction_(itemSelected, model), this.callbackFunction_ = null)
};
goog.ime.ui.CustomPopupMenu.prototype.onDocClick = function $goog$ime$ui$CustomPopupMenu$$onDocClick$(e) {
  goog.ime.ui.CustomPopupMenu.superClass_.onDocClick.call(this, e);
  !this.isVisible() && this.callbackFunction_ && (this.callbackFunction_(!1, ""), this.callbackFunction_ = null)
};
goog.ime.ui.CustomPopupMenu.prototype.handleBlur = function $goog$ime$ui$CustomPopupMenu$$handleBlur$() {
};
goog.ime.ui.PluginProxy = function $goog$ime$ui$PluginProxy$(opt_keys) {
  goog.Disposable.call(this);
  opt_keys = opt_keys || {};
  this.commitKeys = opt_keys.commit || [goog.events.KeyCodes.ENTER];
  this.hideKeys = opt_keys.hide || [goog.events.KeyCodes.ESC];
  this.queryKeys = opt_keys.query || [];
  this.revertKeys = opt_keys.revert || [goog.events.KeyCodes.BACKSPACE];
  new goog.structs.Map
};
goog.inherits(goog.ime.ui.PluginProxy, goog.Disposable);
goog.ime.ui.PluginProxy.prototype.handleQueryKey = goog.functions.FALSE;
goog.ime.ui.PluginProxy.prototype.handleValidCharKey = function $goog$ime$ui$PluginProxy$$handleValidCharKey$(editor, e) {
  return this.handleValidCharKeyInternal(editor, e, String.fromCharCode(e.charCode))
};
goog.ime.ui.PluginProxy.prototype.handleValidCharKeyInternal = goog.functions.FALSE;
goog.ime.ui.PluginProxy.prototype.isCommitKey = function $goog$ime$ui$PluginProxy$$isCommitKey$(editor, e) {
  return goog.array.contains(this.commitKeys, e.keyCode)
};
goog.ime.ui.PluginProxy.prototype.isHideKey = function $goog$ime$ui$PluginProxy$$isHideKey$(editor, e) {
  return goog.array.contains(this.hideKeys, e.keyCode)
};
goog.ime.ui.PluginProxy.prototype.isQueryKey = function $goog$ime$ui$PluginProxy$$isQueryKey$(editor, e) {
  return goog.array.contains(this.queryKeys, e.keyCode)
};
goog.ime.ui.PluginProxy.prototype.isRevertKey = function $goog$ime$ui$PluginProxy$$isRevertKey$(editor, e) {
  return goog.array.contains(this.revertKeys, e.keyCode)
};
goog.ime.ui.PluginProxy.prototype.isValidCharKey = function $goog$ime$ui$PluginProxy$$isValidCharKey$(editor, e) {
  return!!e.charCode && this.isValidCharKeyInternal(editor, e, String.fromCharCode(e.charCode))
};
goog.ime.ui.PluginProxy.prototype.isValidCharKeyInternal = goog.functions.FALSE;
goog.ime.ui.PluginProxy.prototype.isValidChar = goog.functions.FALSE;
goog.ime.ui.PluginProxy.prototype.isPunctuation = goog.functions.FALSE;
goog.ime.ui.PluginProxy.prototype.isCaseSensitive = goog.functions.FALSE;
goog.ime.ui.PluginProxy.prototype.isActive = goog.functions.TRUE;
goog.ime.ui.PluginProxy.prototype.getMappingChar = goog.functions.constant("");
goog.userAgent.product = {};
goog.userAgent.product.ASSUME_FIREFOX = !1;
goog.userAgent.product.ASSUME_CAMINO = !1;
goog.userAgent.product.ASSUME_IPHONE = !1;
goog.userAgent.product.ASSUME_IPAD = !1;
goog.userAgent.product.ASSUME_ANDROID = !1;
goog.userAgent.product.ASSUME_CHROME = !1;
goog.userAgent.product.ASSUME_SAFARI = !1;
goog.userAgent.product.PRODUCT_KNOWN_ = goog.userAgent.ASSUME_IE || goog.userAgent.ASSUME_OPERA || goog.userAgent.product.ASSUME_FIREFOX || goog.userAgent.product.ASSUME_CAMINO || goog.userAgent.product.ASSUME_IPHONE || goog.userAgent.product.ASSUME_IPAD || goog.userAgent.product.ASSUME_ANDROID || goog.userAgent.product.ASSUME_CHROME || goog.userAgent.product.ASSUME_SAFARI;
goog.userAgent.product.init_ = function $goog$userAgent$product$init_$() {
  goog.userAgent.product.detectedFirefox_ = !1;
  goog.userAgent.product.detectedCamino_ = !1;
  goog.userAgent.product.detectedIphone_ = !1;
  goog.userAgent.product.detectedIpad_ = !1;
  goog.userAgent.product.detectedAndroid_ = !1;
  goog.userAgent.product.detectedChrome_ = !1;
  goog.userAgent.product.detectedSafari_ = !1;
  var ua = goog.userAgent.getUserAgentString();
  ua && (-1 != ua.indexOf("Firefox") ? goog.userAgent.product.detectedFirefox_ = !0 : -1 != ua.indexOf("Camino") ? goog.userAgent.product.detectedCamino_ = !0 : -1 != ua.indexOf("iPhone") || -1 != ua.indexOf("iPod") ? goog.userAgent.product.detectedIphone_ = !0 : -1 != ua.indexOf("iPad") ? goog.userAgent.product.detectedIpad_ = !0 : -1 != ua.indexOf("Android") ? goog.userAgent.product.detectedAndroid_ = !0 : -1 != ua.indexOf("Chrome") ? goog.userAgent.product.detectedChrome_ = !0 : -1 != ua.indexOf("Safari") && 
  (goog.userAgent.product.detectedSafari_ = !0))
};
goog.userAgent.product.PRODUCT_KNOWN_ || goog.userAgent.product.init_();
goog.userAgent.product.OPERA = goog.userAgent.OPERA;
goog.userAgent.product.IE = goog.userAgent.IE;
goog.userAgent.product.FIREFOX = goog.userAgent.product.PRODUCT_KNOWN_ ? goog.userAgent.product.ASSUME_FIREFOX : goog.userAgent.product.detectedFirefox_;
goog.userAgent.product.CAMINO = goog.userAgent.product.PRODUCT_KNOWN_ ? goog.userAgent.product.ASSUME_CAMINO : goog.userAgent.product.detectedCamino_;
goog.userAgent.product.IPHONE = goog.userAgent.product.PRODUCT_KNOWN_ ? goog.userAgent.product.ASSUME_IPHONE : goog.userAgent.product.detectedIphone_;
goog.userAgent.product.IPAD = goog.userAgent.product.PRODUCT_KNOWN_ ? goog.userAgent.product.ASSUME_IPAD : goog.userAgent.product.detectedIpad_;
goog.userAgent.product.ANDROID = goog.userAgent.product.PRODUCT_KNOWN_ ? goog.userAgent.product.ASSUME_ANDROID : goog.userAgent.product.detectedAndroid_;
goog.userAgent.product.CHROME = goog.userAgent.product.PRODUCT_KNOWN_ ? goog.userAgent.product.ASSUME_CHROME : goog.userAgent.product.detectedChrome_;
goog.userAgent.product.SAFARI = goog.userAgent.product.PRODUCT_KNOWN_ ? goog.userAgent.product.ASSUME_SAFARI : goog.userAgent.product.detectedSafari_;
goog.userAgent.product.determineVersion_ = function $goog$userAgent$product$determineVersion_$() {
  if(goog.userAgent.product.FIREFOX) {
    return goog.userAgent.product.getFirstRegExpGroup_(/Firefox\/([0-9.]+)/)
  }
  if(goog.userAgent.product.IE || goog.userAgent.product.OPERA) {
    return goog.userAgent.VERSION
  }
  if(goog.userAgent.product.CHROME) {
    return goog.userAgent.product.getFirstRegExpGroup_(/Chrome\/([0-9.]+)/)
  }
  if(goog.userAgent.product.SAFARI) {
    return goog.userAgent.product.getFirstRegExpGroup_(/Version\/([0-9.]+)/)
  }
  if(goog.userAgent.product.IPHONE || goog.userAgent.product.IPAD) {
    var arr = goog.userAgent.product.execRegExp_(/Version\/(\S+).*Mobile\/(\S+)/);
    if(arr) {
      return arr[1] + "." + arr[2]
    }
  }else {
    if(goog.userAgent.product.ANDROID) {
      var version = goog.userAgent.product.getFirstRegExpGroup_(/Android\s+([0-9.]+)/);
      return version ? version : goog.userAgent.product.getFirstRegExpGroup_(/Version\/([0-9.]+)/)
    }
    if(goog.userAgent.product.CAMINO) {
      return goog.userAgent.product.getFirstRegExpGroup_(/Camino\/([0-9.]+)/)
    }
  }
  return""
};
goog.userAgent.product.getFirstRegExpGroup_ = function $goog$userAgent$product$getFirstRegExpGroup_$(re) {
  var arr = goog.userAgent.product.execRegExp_(re);
  return arr ? arr[1] : ""
};
goog.userAgent.product.execRegExp_ = function $goog$userAgent$product$execRegExp_$(re) {
  return re.exec(goog.userAgent.getUserAgentString())
};
goog.userAgent.product.VERSION = goog.userAgent.product.determineVersion_();
goog.userAgent.product.isVersion = function $goog$userAgent$product$isVersion$(version) {
  return 0 <= goog.string.compareVersions(goog.userAgent.product.VERSION, version)
};
goog.editor = {};
goog.editor.defines = {};
goog.editor.defines.USE_CONTENTEDITABLE_IN_FIREFOX_3 = !1;
goog.editor.BrowserFeature = {HAS_IE_RANGES:goog.userAgent.IE && !goog.userAgent.isDocumentMode(9), HAS_W3C_RANGES:goog.userAgent.GECKO || goog.userAgent.WEBKIT || goog.userAgent.OPERA || goog.userAgent.IE && goog.userAgent.isDocumentMode(9), HAS_CONTENT_EDITABLE:goog.userAgent.IE || goog.userAgent.WEBKIT || goog.userAgent.OPERA || goog.editor.defines.USE_CONTENTEDITABLE_IN_FIREFOX_3 && goog.userAgent.GECKO && goog.userAgent.isVersion("1.9"), USE_MUTATION_EVENTS:goog.userAgent.GECKO, HAS_DOM_SUBTREE_MODIFIED_EVENT:goog.userAgent.WEBKIT || 
goog.editor.defines.USE_CONTENTEDITABLE_IN_FIREFOX_3 && goog.userAgent.GECKO && goog.userAgent.isVersion("1.9"), HAS_DOCUMENT_INDEPENDENT_NODES:goog.userAgent.GECKO, PUTS_CURSOR_BEFORE_FIRST_BLOCK_ELEMENT_ON_FOCUS:goog.userAgent.GECKO, CLEARS_SELECTION_WHEN_FOCUS_LEAVES:goog.userAgent.IE || goog.userAgent.WEBKIT || goog.userAgent.OPERA, HAS_UNSELECTABLE_STYLE:goog.userAgent.GECKO || goog.userAgent.WEBKIT, FORMAT_BLOCK_WORKS_FOR_BLOCKQUOTES:goog.userAgent.GECKO || goog.userAgent.WEBKIT || goog.userAgent.OPERA, 
CREATES_MULTIPLE_BLOCKQUOTES:goog.userAgent.WEBKIT && !goog.userAgent.isVersion("534.16") || goog.userAgent.OPERA, WRAPS_BLOCKQUOTE_IN_DIVS:goog.userAgent.OPERA, PREFERS_READY_STATE_CHANGE_EVENT:goog.userAgent.IE, TAB_FIRES_KEYPRESS:!goog.userAgent.IE, NEEDS_99_WIDTH_IN_STANDARDS_MODE:goog.userAgent.IE, USE_DOCUMENT_FOR_KEY_EVENTS:goog.userAgent.GECKO && !goog.editor.defines.USE_CONTENTEDITABLE_IN_FIREFOX_3, SHOWS_CUSTOM_ATTRS_IN_INNER_HTML:goog.userAgent.IE, COLLAPSES_EMPTY_NODES:goog.userAgent.GECKO || 
goog.userAgent.WEBKIT || goog.userAgent.OPERA, CONVERT_TO_B_AND_I_TAGS:goog.userAgent.GECKO || goog.userAgent.OPERA, TABS_THROUGH_IMAGES:goog.userAgent.IE, UNESCAPES_URLS_WITHOUT_ASKING:goog.userAgent.IE && !goog.userAgent.isVersion("7.0"), HAS_STYLE_WITH_CSS:goog.userAgent.GECKO && goog.userAgent.isVersion("1.8") || goog.userAgent.WEBKIT || goog.userAgent.OPERA, FOLLOWS_EDITABLE_LINKS:goog.userAgent.WEBKIT, HAS_ACTIVE_ELEMENT:goog.userAgent.IE || goog.userAgent.OPERA || goog.userAgent.GECKO && goog.userAgent.isVersion("1.9"), 
HAS_SET_CAPTURE:goog.userAgent.IE, EATS_EMPTY_BACKGROUND_COLOR:goog.userAgent.GECKO || goog.userAgent.WEBKIT && !goog.userAgent.isVersion("527"), SUPPORTS_FOCUSIN:goog.userAgent.IE || goog.userAgent.OPERA, SELECTS_IMAGES_ON_CLICK:goog.userAgent.IE || goog.userAgent.OPERA, MOVES_STYLE_TO_HEAD:goog.userAgent.WEBKIT, COLLAPSES_SELECTION_ONMOUSEDOWN:!1, CARET_INSIDE_SELECTION:goog.userAgent.OPERA, FOCUSES_EDITABLE_BODY_ON_HTML_CLICK:!0, USES_KEYDOWN:goog.userAgent.IE || goog.userAgent.WEBKIT && goog.userAgent.isVersion("525"), 
ADDS_NBSPS_IN_REMOVE_FORMAT:goog.userAgent.WEBKIT && !goog.userAgent.isVersion("531"), GETS_STUCK_IN_LINKS:goog.userAgent.WEBKIT && !goog.userAgent.isVersion("528"), NORMALIZE_CORRUPTS_EMPTY_TEXT_NODES:goog.userAgent.GECKO && goog.userAgent.isVersion("1.9") || goog.userAgent.IE || goog.userAgent.OPERA || goog.userAgent.WEBKIT && goog.userAgent.isVersion("531"), NORMALIZE_CORRUPTS_ALL_TEXT_NODES:goog.userAgent.IE, NESTS_SUBSCRIPT_SUPERSCRIPT:goog.userAgent.IE || goog.userAgent.GECKO || goog.userAgent.OPERA, 
CAN_SELECT_EMPTY_ELEMENT:!goog.userAgent.IE && !goog.userAgent.WEBKIT, FORGETS_FORMATTING_WHEN_LISTIFYING:goog.userAgent.GECKO || goog.userAgent.WEBKIT && !goog.userAgent.isVersion("526"), LEAVES_P_WHEN_REMOVING_LISTS:goog.userAgent.IE || goog.userAgent.OPERA, CAN_LISTIFY_BR:!goog.userAgent.IE && !goog.userAgent.OPERA, DOESNT_OVERRIDE_FONT_SIZE_IN_STYLE_ATTR:!goog.userAgent.WEBKIT, SUPPORTS_HTML5_FILE_DRAGGING:goog.userAgent.product.CHROME && goog.userAgent.product.isVersion("4") || goog.userAgent.product.SAFARI && 
goog.userAgent.isVersion("533") || goog.userAgent.GECKO && goog.userAgent.isVersion("2.0"), SUPPORTS_OPERA_DEFAULTBLOCK_COMMAND:goog.userAgent.OPERA && goog.userAgent.isVersion("11.10"), SUPPORTS_FILE_PASTING:goog.userAgent.product.CHROME && goog.userAgent.product.isVersion("12")};
goog.dom.iter = {};
goog.dom.iter.SiblingIterator = function $goog$dom$iter$SiblingIterator$(node, opt_includeNode, opt_reverse) {
  this.node_ = node;
  this.reverse_ = !!opt_reverse;
  node && !opt_includeNode && this.next()
};
goog.inherits(goog.dom.iter.SiblingIterator, goog.iter.Iterator);
goog.dom.iter.SiblingIterator.prototype.next = function $goog$dom$iter$SiblingIterator$$next$() {
  var node = this.node_;
  if(!node) {
    throw goog.iter.StopIteration;
  }
  this.node_ = this.reverse_ ? node.previousSibling : node.nextSibling;
  return node
};
goog.dom.iter.ChildIterator = function $goog$dom$iter$ChildIterator$(element, opt_reverse, opt_startIndex) {
  goog.isDef(opt_startIndex) || (opt_startIndex = opt_reverse && element.childNodes.length ? element.childNodes.length - 1 : 0);
  goog.dom.iter.SiblingIterator.call(this, element.childNodes[opt_startIndex], !0, opt_reverse)
};
goog.inherits(goog.dom.iter.ChildIterator, goog.dom.iter.SiblingIterator);
goog.dom.iter.AncestorIterator = function $goog$dom$iter$AncestorIterator$(node, opt_includeNode) {
  (this.node_ = node) && !opt_includeNode && this.next()
};
goog.inherits(goog.dom.iter.AncestorIterator, goog.iter.Iterator);
goog.dom.iter.AncestorIterator.prototype.next = function $goog$dom$iter$AncestorIterator$$next$() {
  var node = this.node_;
  if(!node) {
    throw goog.iter.StopIteration;
  }
  this.node_ = node.parentNode;
  return node
};
goog.editor.node = {};
goog.editor.node.BLOCK_TAG_NAMES_ = goog.object.createSet("ADDRESS", "BLOCKQUOTE", "BODY", "CAPTION", "CENTER", "COL", "COLGROUP", "DIR", "DIV", "DL", "DD", "DT", "FIELDSET", "FORM", "H1", "H2", "H3", "H4", "H5", "H6", "HR", "ISINDEX", "OL", "LI", "MAP", "MENU", "OPTGROUP", "OPTION", "P", "PRE", "TABLE", "TBODY", "TD", "TFOOT", "TH", "THEAD", "TR", "TL", "UL");
goog.editor.node.NON_EMPTY_TAGS_ = goog.object.createSet(goog.dom.TagName.IMG, goog.dom.TagName.IFRAME, "EMBED");
goog.editor.node.isStandardsMode = function $goog$editor$node$isStandardsMode$(node) {
  return goog.dom.getDomHelper(node).isCss1CompatMode()
};
goog.editor.node.getRightMostLeaf = function $goog$editor$node$getRightMostLeaf$(parent) {
  for(var temp;temp = goog.editor.node.getLastChild(parent);) {
    parent = temp
  }
  return parent
};
goog.editor.node.getLeftMostLeaf = function $goog$editor$node$getLeftMostLeaf$(parent) {
  for(var temp;temp = goog.editor.node.getFirstChild(parent);) {
    parent = temp
  }
  return parent
};
goog.editor.node.getFirstChild = function $goog$editor$node$getFirstChild$(parent) {
  return goog.editor.node.getChildHelper_(parent, !1)
};
goog.editor.node.getLastChild = function $goog$editor$node$getLastChild$(parent) {
  return goog.editor.node.getChildHelper_(parent, !0)
};
goog.editor.node.getPreviousSibling = function $goog$editor$node$getPreviousSibling$(sibling) {
  return goog.editor.node.getFirstValue_(goog.iter.filter(new goog.dom.iter.SiblingIterator(sibling, !1, !0), goog.editor.node.isImportant))
};
goog.editor.node.getNextSibling = function $goog$editor$node$getNextSibling$(sibling) {
  return goog.editor.node.getFirstValue_(goog.iter.filter(new goog.dom.iter.SiblingIterator(sibling), goog.editor.node.isImportant))
};
goog.editor.node.getChildHelper_ = function $goog$editor$node$getChildHelper_$(parent, isReversed) {
  return!parent || parent.nodeType != goog.dom.NodeType.ELEMENT ? null : goog.editor.node.getFirstValue_(goog.iter.filter(new goog.dom.iter.ChildIterator(parent, isReversed), goog.editor.node.isImportant))
};
goog.editor.node.getFirstValue_ = function $goog$editor$node$getFirstValue_$(iterator) {
  try {
    return iterator.next()
  }catch(e) {
    return null
  }
};
goog.editor.node.isImportant = function $goog$editor$node$isImportant$(node) {
  return node.nodeType == goog.dom.NodeType.ELEMENT || node.nodeType == goog.dom.NodeType.TEXT && !goog.editor.node.isAllNonNbspWhiteSpace(node)
};
goog.editor.node.isAllNonNbspWhiteSpace = function $goog$editor$node$isAllNonNbspWhiteSpace$(textNode) {
  return goog.string.isBreakingWhitespace(textNode.nodeValue)
};
goog.editor.node.isEmpty = function $goog$editor$node$isEmpty$(node, opt_prohibitSingleNbsp) {
  var nodeData = goog.dom.getRawTextContent(node);
  if(node.getElementsByTagName) {
    for(var tag in goog.editor.node.NON_EMPTY_TAGS_) {
      if(node.tagName == tag || 0 < node.getElementsByTagName(tag).length) {
        return!1
      }
    }
  }
  return!opt_prohibitSingleNbsp && nodeData == goog.string.Unicode.NBSP || goog.string.isBreakingWhitespace(nodeData)
};
goog.editor.node.getLength = function $goog$editor$node$getLength$(node) {
  return node.length || node.childNodes.length
};
goog.editor.node.findInChildren = function $goog$editor$node$findInChildren$(parent, hasProperty) {
  for(var i = 0, len = parent.childNodes.length;i < len;i++) {
    if(hasProperty(parent.childNodes[i])) {
      return i
    }
  }
  return null
};
goog.editor.node.findHighestMatchingAncestor = function $goog$editor$node$findHighestMatchingAncestor$(node, hasProperty) {
  for(var parent = node.parentNode, ancestor = null;parent && hasProperty(parent);) {
    ancestor = parent, parent = parent.parentNode
  }
  return ancestor
};
goog.editor.node.isBlockTag = function $goog$editor$node$isBlockTag$(node) {
  return!!goog.editor.node.BLOCK_TAG_NAMES_[node.tagName]
};
goog.editor.node.skipEmptyTextNodes = function $goog$editor$node$skipEmptyTextNodes$(node) {
  for(;node && node.nodeType == goog.dom.NodeType.TEXT && !node.nodeValue;) {
    node = node.nextSibling
  }
  return node
};
goog.editor.node.isEditableContainer = function $goog$editor$node$isEditableContainer$(element) {
  return element.getAttribute && "true" == element.getAttribute("g_editable")
};
goog.editor.node.isEditable = function $goog$editor$node$isEditable$(node) {
  return!!goog.dom.getAncestor(node, goog.editor.node.isEditableContainer)
};
goog.editor.node.findTopMostEditableAncestor = function $goog$editor$node$findTopMostEditableAncestor$(node, criteria) {
  for(var targetNode = null;node && !goog.editor.node.isEditableContainer(node);) {
    criteria(node) && (targetNode = node), node = node.parentNode
  }
  return targetNode
};
goog.editor.node.splitDomTreeAt = function $goog$editor$node$splitDomTreeAt$(currentNode, opt_secondHalf, opt_root) {
  for(var parent;currentNode != opt_root && (parent = currentNode.parentNode);) {
    opt_secondHalf = goog.editor.node.getSecondHalfOfNode_(parent, currentNode, opt_secondHalf), currentNode = parent
  }
  return opt_secondHalf
};
goog.editor.node.getSecondHalfOfNode_ = function $goog$editor$node$getSecondHalfOfNode_$(node, startNode, firstChild) {
  for(var secondHalf = node.cloneNode(!1);startNode.nextSibling;) {
    goog.dom.appendChild(secondHalf, startNode.nextSibling)
  }
  firstChild && secondHalf.insertBefore(firstChild, secondHalf.firstChild);
  return secondHalf
};
goog.editor.node.transferChildren = function $goog$editor$node$transferChildren$(newNode, oldNode) {
  goog.dom.append(newNode, oldNode.childNodes)
};
goog.editor.style = {};
goog.editor.style.getComputedOrCascadedStyle_ = function $goog$editor$style$getComputedOrCascadedStyle_$(node, stylePropertyName) {
  return node.nodeType != goog.dom.NodeType.ELEMENT ? null : goog.userAgent.IE ? goog.style.getCascadedStyle(node, stylePropertyName) : goog.style.getComputedStyle(node, stylePropertyName)
};
goog.editor.style.isDisplayBlock = function $goog$editor$style$isDisplayBlock$(node) {
  return"block" == goog.editor.style.getComputedOrCascadedStyle_(node, "display")
};
goog.editor.style.isContainer = function $goog$editor$style$isContainer$(element) {
  var nodeName = element && element.nodeName.toLowerCase();
  return!(!element || !goog.editor.style.isDisplayBlock(element) && !("td" == nodeName || "table" == nodeName || "li" == nodeName))
};
goog.editor.style.getContainer = function $goog$editor$style$getContainer$(node) {
  return goog.dom.getAncestor(node, goog.editor.style.isContainer, !0)
};
goog.editor.style.SELECTABLE_INPUT_TYPES_ = goog.object.createSet("text", "file", "url");
goog.editor.style.cancelMouseDownHelper_ = function $goog$editor$style$cancelMouseDownHelper_$(e) {
  var targetTagName = e.target.tagName;
  targetTagName != goog.dom.TagName.TEXTAREA && targetTagName != goog.dom.TagName.INPUT && e.preventDefault()
};
goog.editor.style.makeUnselectable = function $goog$editor$style$makeUnselectable$(element, eventHandler) {
  goog.editor.BrowserFeature.HAS_UNSELECTABLE_STYLE && eventHandler.listen(element, goog.events.EventType.MOUSEDOWN, goog.editor.style.cancelMouseDownHelper_, !0);
  goog.style.setUnselectable(element, !0);
  for(var inputs = element.getElementsByTagName(goog.dom.TagName.INPUT), i = 0, len = inputs.length;i < len;i++) {
    var input = inputs[i];
    input.type in goog.editor.style.SELECTABLE_INPUT_TYPES_ && goog.editor.style.makeSelectable(input)
  }
  goog.array.forEach(element.getElementsByTagName(goog.dom.TagName.TEXTAREA), goog.editor.style.makeSelectable)
};
goog.editor.style.makeSelectable = function $goog$editor$style$makeSelectable$(element) {
  goog.style.setUnselectable(element, !1);
  if(goog.editor.BrowserFeature.HAS_UNSELECTABLE_STYLE) {
    for(var child = element, current = element.parentNode;current && current.tagName != goog.dom.TagName.HTML;) {
      if(goog.style.isUnselectable(current)) {
        goog.style.setUnselectable(current, !1, !0);
        for(var i = 0, len = current.childNodes.length;i < len;i++) {
          var node = current.childNodes[i];
          node != child && node.nodeType == goog.dom.NodeType.ELEMENT && goog.style.setUnselectable(current.childNodes[i], !0)
        }
      }
      child = current;
      current = current.parentNode
    }
  }
};
goog.editor.range = {};
goog.editor.range.narrow = function $goog$editor$range$narrow$(range, el) {
  var startContainer = range.getStartNode(), endContainer = range.getEndNode();
  if(startContainer && endContainer) {
    var isElement = function $isElement$(node) {
      return node == el
    }, hasStart = goog.dom.getAncestor(startContainer, isElement, !0), hasEnd = goog.dom.getAncestor(endContainer, isElement, !0);
    if(hasStart && hasEnd) {
      return range.clone()
    }
    if(hasStart) {
      var leaf = goog.editor.node.getRightMostLeaf(el);
      return goog.dom.Range.createFromNodes(range.getStartNode(), range.getStartOffset(), leaf, goog.editor.node.getLength(leaf))
    }
    if(hasEnd) {
      return goog.dom.Range.createFromNodes(goog.editor.node.getLeftMostLeaf(el), 0, range.getEndNode(), range.getEndOffset())
    }
  }
  return null
};
goog.editor.range.expand = function $goog$editor$range$expand$(range, opt_stopNode) {
  var expandedRange = goog.editor.range.expandEndPointToContainer_(range, goog.dom.RangeEndpoint.START, opt_stopNode), expandedRange = goog.editor.range.expandEndPointToContainer_(expandedRange, goog.dom.RangeEndpoint.END, opt_stopNode), startNode = expandedRange.getStartNode(), endNode = expandedRange.getEndNode(), startOffset = expandedRange.getStartOffset(), endOffset = expandedRange.getEndOffset();
  if(startNode == endNode) {
    for(;endNode != opt_stopNode && 0 == startOffset && endOffset == goog.editor.node.getLength(endNode);) {
      var parentNode = endNode.parentNode, startOffset = goog.array.indexOf(parentNode.childNodes, endNode), endOffset = startOffset + 1, endNode = parentNode
    }
    startNode = endNode
  }
  return goog.dom.Range.createFromNodes(startNode, startOffset, endNode, endOffset)
};
goog.editor.range.expandEndPointToContainer_ = function $goog$editor$range$expandEndPointToContainer_$(range, endpoint, opt_stopNode) {
  for(var expandStart = endpoint == goog.dom.RangeEndpoint.START, node = expandStart ? range.getStartNode() : range.getEndNode(), offset = expandStart ? range.getStartOffset() : range.getEndOffset(), container = range.getContainerElement();node != container && node != opt_stopNode && !(expandStart && 0 != offset || !expandStart && offset != goog.editor.node.getLength(node));) {
    var parentNode = node.parentNode, index = goog.array.indexOf(parentNode.childNodes, node), offset = expandStart ? index : index + 1, node = parentNode
  }
  return goog.dom.Range.createFromNodes(expandStart ? node : range.getStartNode(), expandStart ? offset : range.getStartOffset(), expandStart ? range.getEndNode() : node, expandStart ? range.getEndOffset() : offset)
};
goog.editor.range.selectNodeStart = function $goog$editor$range$selectNodeStart$(node) {
  goog.dom.Range.createCaret(goog.editor.node.getLeftMostLeaf(node), 0).select()
};
goog.editor.range.placeCursorNextTo = function $goog$editor$range$placeCursorNextTo$(node, toLeft) {
  var parent = node.parentNode, offset = goog.array.indexOf(parent.childNodes, node) + (toLeft ? 0 : 1), point = goog.editor.range.Point.createDeepestPoint(parent, offset, toLeft);
  if(goog.userAgent.IE && goog.userAgent.isVersion("9") && point.node.nodeType == goog.dom.NodeType.ELEMENT && point.node.tagName == goog.dom.TagName.HR) {
    var hr = point.node;
    point.node = hr.parentNode;
    point.offset = goog.array.indexOf(point.node.childNodes, hr) + (toLeft ? 0 : 1)
  }
  var range = goog.dom.Range.createCaret(point.node, point.offset);
  range.select();
  return range
};
goog.editor.range.selectionPreservingNormalize = function $goog$editor$range$selectionPreservingNormalize$(node) {
  var doc = goog.dom.getOwnerDocument(node), selection = goog.dom.Range.createFromWindow(goog.dom.getWindow(doc)), normalizedRange = goog.editor.range.rangePreservingNormalize(node, selection);
  normalizedRange && normalizedRange.select()
};
goog.editor.range.normalizeNodeIe_ = function $goog$editor$range$normalizeNodeIe_$(node) {
  for(var lastText = null, child = node.firstChild;child;) {
    var next = child.nextSibling;
    child.nodeType == goog.dom.NodeType.TEXT ? "" == child.nodeValue ? node.removeChild(child) : lastText ? (lastText.nodeValue += child.nodeValue, node.removeChild(child)) : lastText = child : (goog.editor.range.normalizeNodeIe_(child), lastText = null);
    child = next
  }
};
goog.editor.range.normalizeNode = function $goog$editor$range$normalizeNode$(node) {
  goog.userAgent.IE ? goog.editor.range.normalizeNodeIe_(node) : node.normalize()
};
goog.editor.range.rangePreservingNormalize = function $goog$editor$range$rangePreservingNormalize$(node, range) {
  if(range) {
    var rangeFactory = goog.editor.range.normalize(range), container = goog.editor.style.getContainer(range.getContainerElement())
  }
  container ? goog.editor.range.normalizeNode(goog.dom.findCommonAncestor(container, node)) : node && goog.editor.range.normalizeNode(node);
  return rangeFactory ? rangeFactory() : null
};
goog.editor.range.getDeepEndPoint = function $goog$editor$range$getDeepEndPoint$(range, atStart) {
  return atStart ? goog.editor.range.Point.createDeepestPoint(range.getStartNode(), range.getStartOffset()) : goog.editor.range.Point.createDeepestPoint(range.getEndNode(), range.getEndOffset())
};
goog.editor.range.normalize = function $goog$editor$range$normalize$(range) {
  var startPoint = goog.editor.range.normalizePoint_(goog.editor.range.getDeepEndPoint(range, !0)), startParent = startPoint.getParentPoint(), startPreviousSibling = startPoint.node.previousSibling;
  startPoint.node.nodeType == goog.dom.NodeType.TEXT && (startPoint.node = null);
  var endPoint = goog.editor.range.normalizePoint_(goog.editor.range.getDeepEndPoint(range, !1)), endParent = endPoint.getParentPoint(), endPreviousSibling = endPoint.node.previousSibling;
  endPoint.node.nodeType == goog.dom.NodeType.TEXT && (endPoint.node = null);
  return function() {
    if(!startPoint.node && startPreviousSibling) {
      startPoint.node = startPreviousSibling.nextSibling;
      startPoint.node || (startPoint = goog.editor.range.Point.getPointAtEndOfNode(startPreviousSibling))
    }
    if(!endPoint.node && endPreviousSibling) {
      endPoint.node = endPreviousSibling.nextSibling;
      endPoint.node || (endPoint = goog.editor.range.Point.getPointAtEndOfNode(endPreviousSibling))
    }
    return goog.dom.Range.createFromNodes(startPoint.node || startParent.node.firstChild || startParent.node, startPoint.offset, endPoint.node || endParent.node.firstChild || endParent.node, endPoint.offset)
  }
};
goog.editor.range.normalizePoint_ = function $goog$editor$range$normalizePoint_$(point) {
  var previous;
  if(point.node.nodeType == goog.dom.NodeType.TEXT) {
    for(var current = point.node.previousSibling;current && current.nodeType == goog.dom.NodeType.TEXT;current = current.previousSibling) {
      point.offset += goog.editor.node.getLength(current)
    }
    previous = current
  }else {
    previous = point.node.previousSibling
  }
  var parent = point.node.parentNode;
  point.node = previous ? previous.nextSibling : parent.firstChild;
  return point
};
goog.editor.range.isEditable = function $goog$editor$range$isEditable$(range) {
  var rangeContainer = range.getContainerElement(), rangeContainerIsOutsideRange = range.getStartNode() != rangeContainer.parentElement;
  return rangeContainerIsOutsideRange && goog.editor.node.isEditableContainer(rangeContainer) || goog.editor.node.isEditable(rangeContainer)
};
goog.editor.range.intersectsTag = function $goog$editor$range$intersectsTag$(range, tagName) {
  return goog.dom.getAncestorByTagNameAndClass(range.getContainerElement(), tagName) ? !0 : goog.iter.some(range, function(node) {
    return node.tagName == tagName
  })
};
goog.editor.range.Point = function $goog$editor$range$Point$(node, offset) {
  this.node = node;
  this.offset = offset
};
goog.editor.range.Point.prototype.getParentPoint = function $goog$editor$range$Point$$getParentPoint$() {
  var parent = this.node.parentNode;
  return new goog.editor.range.Point(parent, goog.array.indexOf(parent.childNodes, this.node))
};
goog.editor.range.Point.createDeepestPoint = function $goog$editor$range$Point$createDeepestPoint$(node, offset, opt_trendLeft) {
  for(;node.nodeType == goog.dom.NodeType.ELEMENT;) {
    var child = node.childNodes[offset];
    if(!child && !node.lastChild) {
      break
    }
    if(child) {
      var prevSibling = child.previousSibling;
      opt_trendLeft && prevSibling ? (node = prevSibling, offset = goog.editor.node.getLength(node)) : (node = child, offset = 0)
    }else {
      node = node.lastChild, offset = goog.editor.node.getLength(node)
    }
  }
  return new goog.editor.range.Point(node, offset)
};
goog.editor.range.Point.getPointAtEndOfNode = function $goog$editor$range$Point$getPointAtEndOfNode$(node) {
  return new goog.editor.range.Point(node, goog.editor.node.getLength(node))
};
goog.editor.range.saveUsingNormalizedCarets = function $goog$editor$range$saveUsingNormalizedCarets$(range) {
  return new goog.editor.range.NormalizedCaretRange_(range)
};
goog.editor.range.NormalizedCaretRange_ = function $goog$editor$range$NormalizedCaretRange_$(range) {
  goog.dom.SavedCaretRange.call(this, range)
};
goog.inherits(goog.editor.range.NormalizedCaretRange_, goog.dom.SavedCaretRange);
goog.editor.range.NormalizedCaretRange_.prototype.removeCarets = function $goog$editor$range$NormalizedCaretRange_$$removeCarets$(opt_range) {
  var startCaret = this.getCaret(!0), endCaret = this.getCaret(!1), node = startCaret && endCaret ? goog.dom.findCommonAncestor(startCaret, endCaret) : startCaret || endCaret;
  goog.editor.range.NormalizedCaretRange_.superClass_.removeCarets.call(this);
  if(opt_range) {
    return goog.editor.range.rangePreservingNormalize(node, opt_range)
  }
  node && goog.editor.range.selectionPreservingNormalize(node)
};
goog.math.randomInt = function $goog$math$randomInt$(a) {
  return Math.floor(Math.random() * a)
};
goog.math.uniformRandom = function $goog$math$uniformRandom$(a, b) {
  return a + Math.random() * (b - a)
};
goog.math.clamp = function $goog$math$clamp$(value, min, max) {
  return Math.min(Math.max(value, min), max)
};
goog.math.modulo = function $goog$math$modulo$(a, b) {
  var r = a % b;
  return 0 > r * b ? r + b : r
};
goog.math.lerp = function $goog$math$lerp$(a, b, x) {
  return a + x * (b - a)
};
goog.math.nearlyEquals = function $goog$math$nearlyEquals$(a, b, opt_tolerance) {
  return Math.abs(a - b) <= (opt_tolerance || 1.0E-6)
};
goog.math.standardAngle = function $goog$math$standardAngle$(angle) {
  return goog.math.modulo(angle, 360)
};
goog.math.toRadians = function $goog$math$toRadians$(angleDegrees) {
  return angleDegrees * Math.PI / 180
};
goog.math.toDegrees = function $goog$math$toDegrees$(angleRadians) {
  return 180 * angleRadians / Math.PI
};
goog.math.angleDx = function $goog$math$angleDx$(degrees, radius) {
  return radius * Math.cos(goog.math.toRadians(degrees))
};
goog.math.angleDy = function $goog$math$angleDy$(degrees, radius) {
  return radius * Math.sin(goog.math.toRadians(degrees))
};
goog.math.angle = function $goog$math$angle$(x1, y1, x2, y2) {
  return goog.math.standardAngle(goog.math.toDegrees(Math.atan2(y2 - y1, x2 - x1)))
};
goog.math.angleDifference = function $goog$math$angleDifference$(startAngle, endAngle) {
  var d = goog.math.standardAngle(endAngle) - goog.math.standardAngle(startAngle);
  180 < d ? d -= 360 : -180 >= d && (d = 360 + d);
  return d
};
goog.math.sign = function $goog$math$sign$(x) {
  return 0 == x ? 0 : 0 > x ? -1 : 1
};
goog.math.longestCommonSubsequence = function $goog$math$longestCommonSubsequence$(array1, array2, opt_compareFn, opt_collectorFn) {
  for(var compare = opt_compareFn || function(a, b) {
    return a == b
  }, collect = opt_collectorFn || function(i1) {
    return array1[i1]
  }, length1 = array1.length, length2 = array2.length, arr = [], i = 0;i < length1 + 1;i++) {
    arr[i] = [], arr[i][0] = 0
  }
  for(var j = 0;j < length2 + 1;j++) {
    arr[0][j] = 0
  }
  for(i = 1;i <= length1;i++) {
    for(j = 1;j <= length1;j++) {
      arr[i][j] = compare(array1[i - 1], array2[j - 1]) ? arr[i - 1][j - 1] + 1 : Math.max(arr[i - 1][j], arr[i][j - 1])
    }
  }
  for(var result = [], i = length1, j = length2;0 < i && 0 < j;) {
    compare(array1[i - 1], array2[j - 1]) ? (result.unshift(collect(i - 1, j - 1)), i--, j--) : arr[i - 1][j] > arr[i][j - 1] ? i-- : j--
  }
  return result
};
goog.math.sum = function $goog$math$sum$(var_args) {
  return goog.array.reduce(arguments, function(sum, value) {
    return sum + value
  }, 0)
};
goog.math.average = function $goog$math$average$(var_args) {
  return goog.math.sum.apply(null, arguments) / arguments.length
};
goog.math.standardDeviation = function $goog$math$standardDeviation$(var_args) {
  var sampleSize = arguments.length;
  if(2 > sampleSize) {
    return 0
  }
  var mean = goog.math.average.apply(null, arguments), variance = goog.math.sum.apply(null, goog.array.map(arguments, function(val) {
    return Math.pow(val - mean, 2)
  })) / (sampleSize - 1);
  return Math.sqrt(variance)
};
goog.math.isInt = function $goog$math$isInt$(num) {
  return isFinite(num) && 0 == num % 1
};
goog.math.isFiniteNumber = function $goog$math$isFiniteNumber$(num) {
  return isFinite(num) && !isNaN(num)
};
goog.ui.ButtonSide = {NONE:0, START:1, END:2, BOTH:3};
goog.ui.ButtonRenderer = function $goog$ui$ButtonRenderer$() {
};
goog.inherits(goog.ui.ButtonRenderer, goog.ui.ControlRenderer);
goog.addSingletonGetter(goog.ui.ButtonRenderer);
goog.ui.ButtonRenderer.CSS_CLASS = "ita-button";
goog.ui.ButtonRenderer.prototype.getAriaRole = function $goog$ui$ButtonRenderer$$getAriaRole$() {
  return goog.dom.a11y.Role.BUTTON
};
goog.ui.ButtonRenderer.prototype.updateAriaState = function $goog$ui$ButtonRenderer$$updateAriaState$(element, state, enable) {
  state == goog.ui.Component.State.CHECKED ? goog.dom.a11y.setState(element, goog.dom.a11y.State.PRESSED, enable) : goog.ui.ButtonRenderer.superClass_.updateAriaState.call(this, element, state, enable)
};
goog.ui.ButtonRenderer.prototype.createDom = function $goog$ui$ButtonRenderer$$createDom$(button) {
  var element = goog.ui.ButtonRenderer.superClass_.createDom.call(this, button), tooltip = button.getTooltip();
  tooltip && this.setTooltip(element, tooltip);
  var value = button.getValue();
  value && this.setValue(element, value);
  button.isSupportedState(goog.ui.Component.State.CHECKED) && this.updateAriaState(element, goog.ui.Component.State.CHECKED, button.isChecked());
  return element
};
goog.ui.ButtonRenderer.prototype.decorate = function $goog$ui$ButtonRenderer$$decorate$(button, element) {
  element = goog.ui.ButtonRenderer.superClass_.decorate.call(this, button, element);
  button.setValueInternal(this.getValue(element));
  button.setTooltipInternal(this.getTooltip(element));
  button.isSupportedState(goog.ui.Component.State.CHECKED) && this.updateAriaState(element, goog.ui.Component.State.CHECKED, button.isChecked());
  return element
};
goog.ui.ButtonRenderer.prototype.getValue = goog.nullFunction;
goog.ui.ButtonRenderer.prototype.setValue = goog.nullFunction;
goog.ui.ButtonRenderer.prototype.getTooltip = function $goog$ui$ButtonRenderer$$getTooltip$(element) {
  return element.title
};
goog.ui.ButtonRenderer.prototype.setTooltip = function $goog$ui$ButtonRenderer$$setTooltip$(element, tooltip) {
  element && (element.title = tooltip || "")
};
goog.ui.ButtonRenderer.prototype.getCssClass = function $goog$ui$ButtonRenderer$$getCssClass$() {
  return goog.ui.ButtonRenderer.CSS_CLASS
};
goog.ui.NativeButtonRenderer = function $goog$ui$NativeButtonRenderer$() {
};
goog.inherits(goog.ui.NativeButtonRenderer, goog.ui.ButtonRenderer);
goog.addSingletonGetter(goog.ui.NativeButtonRenderer);
goog.ui.NativeButtonRenderer.prototype.getAriaRole = function $goog$ui$NativeButtonRenderer$$getAriaRole$() {
};
goog.ui.NativeButtonRenderer.prototype.createDom = function $goog$ui$NativeButtonRenderer$$createDom$(button) {
  this.setUpNativeButton_(button);
  return button.getDomHelper().createDom("button", {"class":this.getClassNames(button).join(" "), disabled:!button.isEnabled(), title:button.getTooltip() || "", value:button.getValue() || ""}, button.getCaption() || "")
};
goog.ui.NativeButtonRenderer.prototype.canDecorate = function $goog$ui$NativeButtonRenderer$$canDecorate$(element) {
  return"BUTTON" == element.tagName || "INPUT" == element.tagName && ("button" == element.type || "submit" == element.type || "reset" == element.type)
};
goog.ui.NativeButtonRenderer.prototype.decorate = function $goog$ui$NativeButtonRenderer$$decorate$(button, element) {
  this.setUpNativeButton_(button);
  element.disabled && goog.dom.classes.add(element, this.getClassForState(goog.ui.Component.State.DISABLED));
  return goog.ui.NativeButtonRenderer.superClass_.decorate.call(this, button, element)
};
goog.ui.NativeButtonRenderer.prototype.initializeDom = function $goog$ui$NativeButtonRenderer$$initializeDom$(button) {
  button.getHandler().listen(button.getElement(), goog.events.EventType.CLICK, button.performActionInternal)
};
goog.ui.NativeButtonRenderer.prototype.setAllowTextSelection = goog.nullFunction;
goog.ui.NativeButtonRenderer.prototype.setRightToLeft = goog.nullFunction;
goog.ui.NativeButtonRenderer.prototype.isFocusable = function $goog$ui$NativeButtonRenderer$$isFocusable$(button) {
  return button.isEnabled()
};
goog.ui.NativeButtonRenderer.prototype.setFocusable = goog.nullFunction;
goog.ui.NativeButtonRenderer.prototype.setState = function $goog$ui$NativeButtonRenderer$$setState$(button, state, enable) {
  goog.ui.NativeButtonRenderer.superClass_.setState.call(this, button, state, enable);
  var element = button.getElement();
  element && state == goog.ui.Component.State.DISABLED && (element.disabled = enable)
};
goog.ui.NativeButtonRenderer.prototype.getValue = function $goog$ui$NativeButtonRenderer$$getValue$(element) {
  return element.value
};
goog.ui.NativeButtonRenderer.prototype.setValue = function $goog$ui$NativeButtonRenderer$$setValue$(element, value) {
  element && (element.value = value)
};
goog.ui.NativeButtonRenderer.prototype.updateAriaState = goog.nullFunction;
goog.ui.NativeButtonRenderer.prototype.setUpNativeButton_ = function $goog$ui$NativeButtonRenderer$$setUpNativeButton_$(button) {
  button.setHandleMouseEvents(!1);
  button.setAutoStates(goog.ui.Component.State.ALL, !1);
  button.setSupportedState(goog.ui.Component.State.FOCUSED, !1)
};
goog.ui.Button = function $goog$ui$Button$(content, opt_renderer, opt_domHelper) {
  goog.ui.Control.call(this, content, opt_renderer || goog.ui.NativeButtonRenderer.getInstance(), opt_domHelper)
};
goog.inherits(goog.ui.Button, goog.ui.Control);
goog.ui.Button.Side = goog.ui.ButtonSide;
goog.ui.Button.prototype.getValue = function $goog$ui$Button$$getValue$() {
  return this.value_
};
goog.ui.Button.prototype.setValue = function $goog$ui$Button$$setValue$(value) {
  this.value_ = value;
  var renderer = this.getRenderer();
  renderer.setValue(this.getElement(), value)
};
goog.ui.Button.prototype.setValueInternal = function $goog$ui$Button$$setValueInternal$(value) {
  this.value_ = value
};
goog.ui.Button.prototype.getTooltip = function $goog$ui$Button$$getTooltip$() {
  return this.tooltip_
};
goog.ui.Button.prototype.setTooltip = function $goog$ui$Button$$setTooltip$(tooltip) {
  this.tooltip_ = tooltip;
  this.getRenderer().setTooltip(this.getElement(), tooltip)
};
goog.ui.Button.prototype.setTooltipInternal = function $goog$ui$Button$$setTooltipInternal$(tooltip) {
  this.tooltip_ = tooltip
};
goog.ui.Button.prototype.disposeInternal = function $goog$ui$Button$$disposeInternal$() {
  goog.ui.Button.superClass_.disposeInternal.call(this);
  delete this.value_;
  delete this.tooltip_
};
goog.ui.Button.prototype.enterDocument = function $goog$ui$Button$$enterDocument$() {
  goog.ui.Button.superClass_.enterDocument.call(this);
  if(this.isSupportedState(goog.ui.Component.State.FOCUSED)) {
    var keyTarget = this.getKeyEventTarget();
    keyTarget && this.getHandler().listen(keyTarget, goog.events.EventType.KEYUP, this.handleKeyEventInternal)
  }
};
goog.ui.Button.prototype.handleKeyEventInternal = function $goog$ui$Button$$handleKeyEventInternal$(e) {
  return e.keyCode == goog.events.KeyCodes.ENTER && e.type == goog.events.KeyHandler.EventType.KEY || e.keyCode == goog.events.KeyCodes.SPACE && e.type == goog.events.EventType.KEYUP ? this.performActionInternal(e) : e.keyCode == goog.events.KeyCodes.SPACE
};
goog.ui.registry.setDecoratorByClassName(goog.ui.ButtonRenderer.CSS_CLASS, function() {
  return new goog.ui.Button(null)
});
goog.ui.INLINE_BLOCK_CLASSNAME = "ita-inline-block";
goog.ui.CustomButtonRenderer = function $goog$ui$CustomButtonRenderer$() {
};
goog.inherits(goog.ui.CustomButtonRenderer, goog.ui.ButtonRenderer);
goog.addSingletonGetter(goog.ui.CustomButtonRenderer);
goog.ui.CustomButtonRenderer.CSS_CLASS = "ita-custom-button";
goog.ui.CustomButtonRenderer.prototype.createDom = function $goog$ui$CustomButtonRenderer$$createDom$(button) {
  var classNames = this.getClassNames(button), attributes = {"class":goog.ui.INLINE_BLOCK_CLASSNAME + " " + classNames.join(" "), title:button.getTooltip() || ""}, buttonElement = button.getDomHelper().createDom("div", attributes, this.createButton(button.getContent(), button.getDomHelper()));
  this.setAriaStates(button, buttonElement);
  return buttonElement
};
goog.ui.CustomButtonRenderer.prototype.getAriaRole = function $goog$ui$CustomButtonRenderer$$getAriaRole$() {
  return goog.dom.a11y.Role.BUTTON
};
goog.ui.CustomButtonRenderer.prototype.setAriaStates = function $goog$ui$CustomButtonRenderer$$setAriaStates$(button, element) {
  goog.asserts.assert(button);
  goog.asserts.assert(element);
  button.isEnabled() || this.updateAriaState(element, goog.ui.Component.State.DISABLED, !0);
  button.isSelected() && this.updateAriaState(element, goog.ui.Component.State.SELECTED, !0);
  button.isSupportedState(goog.ui.Component.State.CHECKED) && this.updateAriaState(element, goog.ui.Component.State.CHECKED, !0);
  button.isOpen() && this.updateAriaState(element, goog.ui.Component.State.OPENED, !0)
};
goog.ui.CustomButtonRenderer.prototype.getContentElement = function $goog$ui$CustomButtonRenderer$$getContentElement$(element) {
  return element && element.firstChild.firstChild
};
goog.ui.CustomButtonRenderer.prototype.createButton = function $goog$ui$CustomButtonRenderer$$createButton$(content, dom) {
  return dom.createDom("div", goog.ui.INLINE_BLOCK_CLASSNAME + " " + (this.getCssClass() + "-outer-box"), dom.createDom("div", goog.ui.INLINE_BLOCK_CLASSNAME + " " + (this.getCssClass() + "-inner-box"), content))
};
goog.ui.CustomButtonRenderer.prototype.canDecorate = function $goog$ui$CustomButtonRenderer$$canDecorate$(element) {
  return"DIV" == element.tagName
};
goog.ui.CustomButtonRenderer.prototype.hasBoxStructure = function $goog$ui$CustomButtonRenderer$$hasBoxStructure$(button, element) {
  var outer = button.getDomHelper().getFirstElementChild(element);
  if(outer && -1 != outer.className.indexOf(this.getCssClass() + "-outer-box")) {
    var inner = button.getDomHelper().getFirstElementChild(outer);
    if(inner && -1 != inner.className.indexOf(this.getCssClass() + "-inner-box")) {
      return!0
    }
  }
  return!1
};
goog.ui.CustomButtonRenderer.prototype.decorate = function $goog$ui$CustomButtonRenderer$$decorate$(button, element) {
  goog.ui.CustomButtonRenderer.trimTextNodes_(element, !0);
  goog.ui.CustomButtonRenderer.trimTextNodes_(element, !1);
  this.hasBoxStructure(button, element) || element.appendChild(this.createButton(element.childNodes, button.getDomHelper()));
  goog.dom.classes.add(element, goog.ui.INLINE_BLOCK_CLASSNAME, this.getCssClass());
  return goog.ui.CustomButtonRenderer.superClass_.decorate.call(this, button, element)
};
goog.ui.CustomButtonRenderer.prototype.getCssClass = function $goog$ui$CustomButtonRenderer$$getCssClass$() {
  return goog.ui.CustomButtonRenderer.CSS_CLASS
};
goog.ui.CustomButtonRenderer.trimTextNodes_ = function $goog$ui$CustomButtonRenderer$trimTextNodes_$(element, fromStart) {
  if(element) {
    for(var node = fromStart ? element.firstChild : element.lastChild, next;node && node.parentNode == element;) {
      next = fromStart ? node.nextSibling : node.previousSibling;
      if(node.nodeType == goog.dom.NodeType.TEXT) {
        var text = node.nodeValue;
        if("" == goog.string.trim(text)) {
          element.removeChild(node)
        }else {
          node.nodeValue = fromStart ? goog.string.trimLeft(text) : goog.string.trimRight(text);
          break
        }
      }else {
        break
      }
      node = next
    }
  }
};
goog.ui.CustomButton = function $goog$ui$CustomButton$(content, opt_renderer, opt_domHelper) {
  goog.ui.Button.call(this, content, opt_renderer || goog.ui.CustomButtonRenderer.getInstance(), opt_domHelper)
};
goog.inherits(goog.ui.CustomButton, goog.ui.Button);
goog.ui.registry.setDecoratorByClassName(goog.ui.CustomButtonRenderer.CSS_CLASS, function() {
  return new goog.ui.CustomButton(null)
});
goog.structs.StringSet = function $goog$structs$StringSet$(opt_elements) {
  this.elements_ = {};
  if(opt_elements) {
    for(var i = 0;i < opt_elements.length;i++) {
      this.elements_[this.encode(opt_elements[i])] = null
    }
  }
};
goog.structs.StringSet.EMPTY_OBJECT_ = {};
goog.structs.StringSet.prototype.encode = function $goog$structs$StringSet$$encode$(element) {
  return element in goog.structs.StringSet.EMPTY_OBJECT_ || 32 == ("" + element).charCodeAt(0) ? " " + element : element
};
goog.structs.StringSet.prototype.decode = function $goog$structs$StringSet$$decode$(key) {
  return 32 == key.charCodeAt(0) ? key.substr(1) : key
};
goog.structs.StringSet.prototype.add = function $goog$structs$StringSet$$add$(element) {
  this.elements_[this.encode(element)] = null
};
goog.structs.StringSet.prototype.addSet = function $goog$structs$StringSet$$addSet$(stringSet) {
  for(var key in stringSet.elements_) {
    stringSet.elements_.hasOwnProperty(key) && (this.elements_[key] = null)
  }
};
goog.structs.StringSet.prototype.clear = function $goog$structs$StringSet$$clear$() {
  this.elements_ = {}
};
goog.structs.StringSet.prototype.clone = function $goog$structs$StringSet$$clone$() {
  var ret = new goog.structs.StringSet;
  ret.addSet(this);
  return ret
};
goog.structs.StringSet.prototype.contains = function $goog$structs$StringSet$$contains$(element) {
  return this.elements_.hasOwnProperty(this.encode(element))
};
goog.structs.StringSet.prototype.equals = function $goog$structs$StringSet$$equals$(stringSet) {
  return this.isSubsetOf(stringSet) && stringSet.isSubsetOf(this)
};
goog.structs.StringSet.prototype.forEach = function $goog$structs$StringSet$$forEach$(f, opt_obj) {
  for(var key in this.elements_) {
    this.elements_.hasOwnProperty(key) && f.call(opt_obj, this.decode(key), void 0, this)
  }
};
goog.structs.StringSet.prototype.getCount = function $goog$structs$StringSet$$getCount$() {
  var count = 0, key;
  for(key in this.elements_) {
    this.elements_.hasOwnProperty(key) && count++
  }
  return count
};
goog.structs.StringSet.prototype.getValues = function $goog$structs$StringSet$$getValues$() {
  var ret = [], key;
  for(key in this.elements_) {
    this.elements_.hasOwnProperty(key) && ret.push(this.decode(key))
  }
  return ret
};
goog.structs.StringSet.prototype.isEmpty = function $goog$structs$StringSet$$isEmpty$() {
  for(var key in this.elements_) {
    if(this.elements_.hasOwnProperty(key)) {
      return!1
    }
  }
  return!0
};
goog.structs.StringSet.prototype.isSubsetOf = function $goog$structs$StringSet$$isSubsetOf$(stringSet) {
  for(var key in this.elements_) {
    if(!stringSet.elements_.hasOwnProperty(key) && this.elements_.hasOwnProperty(key)) {
      return!1
    }
  }
  return!0
};
goog.structs.StringSet.prototype.remove = function $goog$structs$StringSet$$remove$(element) {
  var key = this.encode(element);
  return this.elements_.hasOwnProperty(key) ? (delete this.elements_[key], !0) : !1
};
goog.structs.StringSet.prototype.__iterator__ = function $goog$structs$StringSet$$__iterator__$() {
  return goog.iter.toIterator(this.getValues())
};
goog.ime.plugin.lang.StaticTransliterator = function $goog$ime$plugin$lang$StaticTransliterator$() {
  this.mappers_ = {}
};
goog.ime.plugin.lang.StaticTransliterator.prototype.register = function $goog$ime$plugin$lang$StaticTransliterator$$register$(langCodePair, mapperFn) {
  this.mappers_[langCodePair.toString()] = mapperFn
};
goog.ime.plugin.lang.StaticTransliterator.prototype.get = function $goog$ime$plugin$lang$StaticTransliterator$$get$(langCodePair, e) {
  var mapper = this.mappers_[langCodePair.toString()], str = goog.isString(e) ? e : String.fromCharCode(e.charCode);
  if(mapper) {
    var mappedStr = mapper(str);
    if(mappedStr && mappedStr != str) {
      return new goog.ime.plugin.lang.TranslitSuggestion(str, [mappedStr])
    }
  }
  return null
};
goog.ime.plugin.lang.StaticTransliterator.prototype.getMappingChar = function $goog$ime$plugin$lang$StaticTransliterator$$getMappingChar$(inputTool, ch, var_args) {
  var mapper = this.mappers_[inputTool.getLanguagePair().toString()], mappedChar;
  if(mapper) {
    if(2 < arguments.length) {
      var args = Array.prototype.slice.call(arguments, 1);
      mappedChar = mapper.apply(this, args)
    }else {
      mappedChar = mapper(ch)
    }
  }
  return mappedChar && mappedChar != ch ? mappedChar : ""
};
goog.ime.plugin.lang.StaticTransliterator.defaultTransliterator_ = null;
goog.ime.plugin.lang.StaticTransliterator.EthiopicCharMappings_ = {".":"\u1362", ",":"\u1363"};
goog.ime.plugin.lang.StaticTransliterator.RtlCharMappings_ = {",":"\u060c", ";":"\u061b", "?":"\u061f", "0":"\u0660", 1:"\u0661", 2:"\u0662", 3:"\u0663", 4:"\u0664", 5:"\u0665", 6:"\u0666", 7:"\u0667", 8:"\u0668", 9:"\u0669"};
goog.ime.plugin.lang.StaticTransliterator.BengaliCharMappings_ = {"0":"\u09e6", 1:"\u09e7", 2:"\u09e8", 3:"\u09e9", 4:"\u09ea", 5:"\u09eb", 6:"\u09ec", 7:"\u09ed", 8:"\u09ee", 9:"\u09ef", "|":"\u0964"};
goog.ime.plugin.lang.StaticTransliterator.IndicCharMappings_ = {"|":"\u0964"};
goog.ime.plugin.lang.StaticTransliterator.ChineseCharMappings_ = {"0":"\uff10", 1:"\uff11", 2:"\uff12", 3:"\uff13", 4:"\uff14", 5:"\uff15", 6:"\uff16", 7:"\uff17", 8:"\uff18", 9:"\uff19", a:"\uff41", b:"\uff42", c:"\uff43", d:"\uff44", e:"\uff45", f:"\uff46", g:"\uff47", h:"\uff48", i:"\uff49", j:"\uff4a", k:"\uff4b", l:"\uff4c", m:"\uff4d", n:"\uff4e", o:"\uff4f", p:"\uff50", q:"\uff51", r:"\uff52", s:"\uff53", t:"\uff54", u:"\uff55", v:"\uff56", w:"\uff57", x:"\uff58", y:"\uff59", z:"\uff5a", A:"\uff21", 
B:"\uff22", C:"\uff23", D:"\uff24", E:"\uff25", F:"\uff26", G:"\uff27", H:"\uff28", I:"\uff29", J:"\uff2a", K:"\uff2b", L:"\uff2c", M:"\uff2d", N:"\uff2e", O:"\uff2f", P:"\uff30", Q:"\uff31", R:"\uff32", S:"\uff33", T:"\uff34", U:"\uff35", V:"\uff36", W:"\uff37", X:"\uff38", Y:"\uff39", Z:"\uff3a"};
goog.ime.plugin.lang.StaticTransliterator.EnglishPunctuationDBCMappings_ = {"~":"\uff5e", "`":"\uff40", "!":"\uff01", "@":"\uff20", "#":"\uff03", $:"\uff04", "%":"\uff05", "^":"\uff3e", "&":"\uff06", "*":"\uff0a", "(":"\uff08", ")":"\uff09", _:"\uff3f", "-":"\uff0d", "+":"\uff0b", "=":"\uff1d", "{":"\uff5b", "[":"\uff3b", "}":"\uff5d", "]":"\uff3d", "|":"\uff5c", "\\":"\uff3c", ":":"\uff1a", ";":"\uff1b", '"':"\uff02", "'":"\uff07", "<":"\uff1c", ",":"\uff0c", ">":"\uff1e", ".":"\uff0e", "?":"\uff1f", 
"/":"\uff0f"};
goog.ime.plugin.lang.StaticTransliterator.ChinesePunctuationSBCMappings_ = {"~":"\uff5e", "`":"\u00b7", "!":"\uff01", "@":"@", "#":"#", $:"\uffe5", "%":"%", "^":"\u2026\u2026", "&":"&", "*":"\u00d7", "(":"\uff08", ")":"\uff09", _:"\u2014\u2014", "-":"-", "+":"+", "=":"=", "{":"\u300e", "[":"\u3010", "}":"\u300f", "]":"\u3011", "|":"|", "\\":"\u3001", ":":"\uff1a", ";":"\uff1b", "<":"\u300a", ",":"\uff0c", ">":"\u300b", ".":"\u3002", "?":"\uff1f", "/":"/"};
goog.ime.plugin.lang.StaticTransliterator.ChinesePunctuationDBCMappings_ = {"~":"\uff5e", "`":"\uff40", "!":"\uff01", "@":"\uff20", "#":"\uff03", $:"\uffe5", "%":"\uff05", "^":"\u2026\u2026", "&":"\uff06", "*":"\u00d7", "(":"\uff08", ")":"\uff09", _:"\u2014\u2014", "-":"\uff0d", "+":"\uff0b", "=":"\uff1d", "{":"\uff5b", "[":"\u3010", "}":"\uff5d", "]":"\u3011", "|":"\uff5c", "\\":"\u3001", ":":"\uff1a", ";":"\uff1b", "<":"\u300a", ",":"\uff0c", ">":"\u300b", ".":"\u3002", "?":"\uff1f", "/":"\uff0f"};
goog.ime.plugin.lang.StaticTransliterator.ChineseAlternatingCharMappings_ = {"'":["\u2018\u2019"], '"':["\u201c\u201d"]};
goog.ime.plugin.lang.StaticTransliterator.JapaneseMapping_ = {va:"\u3094\u3041", vi:"\u3094\u3043", vu:"\u3094", ve:"\u3094\u3047", vo:"\u3094\u3049", vya:"\u3094\u3083", vyi:"\u3094\u3043", vyu:"\u3094\u3085", vye:"\u3094\u3047", vyo:"\u3094\u3087", qq:"\u3063q", vv:"\u3063v", ll:"\u3063l", xx:"\u3063x", kk:"\u3063k", gg:"\u3063g", ss:"\u3063s", zz:"\u3063z", jj:"\u3063j", tt:"\u3063t", dd:"\u3063d", hh:"\u3063h", ff:"\u3063f", bb:"\u3063b", pp:"\u3063p", mm:"\u3063m", yy:"\u3063y", rr:"\u3063r", 
wwa:"\u3063\u308f", wwi:"\u3063\u3046\u3043", wwu:"\u3063\u3046", wwe:"\u3063\u3046\u3047", wwo:"\u3063\u3092", wwyi:"\u3063\u3090", wwye:"\u3063\u3091", wwha:"\u3063\u3046\u3041", wwhi:"\u3063\u3046\u3043", wwhu:"\u3063\u3046", wwhe:"\u3063\u3046\u3047", wwho:"\u3063\u3046\u3049", cc:"\u3063c", kya:"\u304d\u3083", kyi:"\u304d\u3043", kyu:"\u304d\u3085", kye:"\u304d\u3047", kyo:"\u304d\u3087", gya:"\u304e\u3083", gyi:"\u304e\u3043", gyu:"\u304e\u3085", gye:"\u304e\u3047", gyo:"\u304e\u3087", sya:"\u3057\u3083", 
syi:"\u3057\u3043", syu:"\u3057\u3085", sye:"\u3057\u3047", syo:"\u3057\u3087", sha:"\u3057\u3083", shi:"\u3057", shu:"\u3057\u3085", she:"\u3057\u3047", sho:"\u3057\u3087", zya:"\u3058\u3083", zyi:"\u3058\u3043", zyu:"\u3058\u3085", zye:"\u3058\u3047", zyo:"\u3058\u3087", tya:"\u3061\u3083", tyi:"\u3061\u3043", tyu:"\u3061\u3085", tye:"\u3061\u3047", tyo:"\u3061\u3087", cha:"\u3061\u3083", chi:"\u3061", chu:"\u3061\u3085", che:"\u3061\u3047", cho:"\u3061\u3087", cya:"\u3061\u3083", cyi:"\u3061\u3043", 
cyu:"\u3061\u3085", cye:"\u3061\u3047", cyo:"\u3061\u3087", dya:"\u3062\u3083", dyi:"\u3062\u3043", dyu:"\u3062\u3085", dye:"\u3062\u3047", dyo:"\u3062\u3087", tsa:"\u3064\u3041", tsi:"\u3064\u3043", tse:"\u3064\u3047", tso:"\u3064\u3049", tha:"\u3066\u3083", thi:"\u3066\u3043", "t'i":"\u3066\u3043", thu:"\u3066\u3085", the:"\u3066\u3047", tho:"\u3066\u3087", "t'yu":"\u3066\u3085", dha:"\u3067\u3083", dhi:"\u3067\u3043", "d'i":"\u3067\u3043", dhu:"\u3067\u3085", dhe:"\u3067\u3047", dho:"\u3067\u3087", 
"d'yu":"\u3067\u3085", twa:"\u3068\u3041", twi:"\u3068\u3043", twu:"\u3068\u3045", twe:"\u3068\u3047", two:"\u3068\u3049", "t'u":"\u3068\u3045", dwa:"\u3069\u3041", dwi:"\u3069\u3043", dwu:"\u3069\u3045", dwe:"\u3069\u3047", dwo:"\u3069\u3049", "d'u":"\u3069\u3045", nya:"\u306b\u3083", nyi:"\u306b\u3043", nyu:"\u306b\u3085", nye:"\u306b\u3047", nyo:"\u306b\u3087", hya:"\u3072\u3083", hyi:"\u3072\u3043", hyu:"\u3072\u3085", hye:"\u3072\u3047", hyo:"\u3072\u3087", bya:"\u3073\u3083", byi:"\u3073\u3043", 
byu:"\u3073\u3085", bye:"\u3073\u3047", byo:"\u3073\u3087", pya:"\u3074\u3083", pyi:"\u3074\u3043", pyu:"\u3074\u3085", pye:"\u3074\u3047", pyo:"\u3074\u3087", fa:"\u3075\u3041", fi:"\u3075\u3043", fe:"\u3075\u3047", fo:"\u3075\u3049", fya:"\u3075\u3083", fyu:"\u3075\u3085", fyo:"\u3075\u3087", hwa:"\u3075\u3041", hwi:"\u3075\u3043", hwe:"\u3075\u3047", hwo:"\u3075\u3049", hwyu:"\u3075\u3085", mya:"\u307f\u3083", myi:"\u307f\u3043", myu:"\u307f\u3085", mye:"\u307f\u3047", myo:"\u307f\u3087", rya:"\u308a\u3083", 
ryi:"\u308a\u3043", ryu:"\u308a\u3085", rye:"\u308a\u3047", ryo:"\u308a\u3087", "n'":"\u3093", nn:"\u3093", xn:"\u3093", a:"\u3042", i:"\u3044", u:"\u3046", wu:"\u3046", e:"\u3048", o:"\u304a", xa:"\u3041", xi:"\u3043", xu:"\u3045", xe:"\u3047", xo:"\u3049", la:"\u3041", li:"\u3043", lu:"\u3045", le:"\u3047", lo:"\u3049", lyi:"\u3043", xyi:"\u3043", lye:"\u3047", xye:"\u3047", ye:"\u3044\u3047", ka:"\u304b", ki:"\u304d", ku:"\u304f", ke:"\u3051", ko:"\u3053", xka:"\u30f5", xke:"\u30f6", lka:"\u30f5", 
lke:"\u30f6", ga:"\u304c", gi:"\u304e", gu:"\u3050", ge:"\u3052", go:"\u3054", sa:"\u3055", si:"\u3057", su:"\u3059", se:"\u305b", so:"\u305d", ca:"\u304b", ci:"\u3057", cu:"\u304f", ce:"\u305b", co:"\u3053", qa:"\u304f\u3041", qi:"\u304f\u3043", qu:"\u304f", qe:"\u304f\u3047", qo:"\u304f\u3049", kwa:"\u304f\u3041", kwi:"\u304f\u3043", kwe:"\u304f\u3047", kwo:"\u304f\u3049", gwa:"\u3050\u3041", za:"\u3056", zi:"\u3058", zu:"\u305a", ze:"\u305c", zo:"\u305e", ja:"\u3058\u3083", ji:"\u3058", ju:"\u3058\u3085", 
je:"\u3058\u3047", jo:"\u3058\u3087", jya:"\u3058\u3083", jyi:"\u3058\u3043", jyu:"\u3058\u3085", jye:"\u3058\u3047", jyo:"\u3058\u3087", ta:"\u305f", ti:"\u3061", tu:"\u3064", tsu:"\u3064", te:"\u3066", to:"\u3068", da:"\u3060", di:"\u3062", du:"\u3065", de:"\u3067", "do":"\u3069", xtu:"\u3063", xtsu:"\u3063", ltu:"\u3063", ltsu:"\u3063", na:"\u306a", ni:"\u306b", nu:"\u306c", ne:"\u306d", no:"\u306e", ha:"\u306f", hi:"\u3072", hu:"\u3075", fu:"\u3075", he:"\u3078", ho:"\u307b", ba:"\u3070", bi:"\u3073", 
bu:"\u3076", be:"\u3079", bo:"\u307c", pa:"\u3071", pi:"\u3074", pu:"\u3077", pe:"\u307a", po:"\u307d", ma:"\u307e", mi:"\u307f", mu:"\u3080", me:"\u3081", mo:"\u3082", xya:"\u3083", lya:"\u3083", ya:"\u3084", wyi:"\u3090", xyu:"\u3085", lyu:"\u3085", yu:"\u3086", wye:"\u3091", xyo:"\u3087", lyo:"\u3087", yo:"\u3088", ra:"\u3089", ri:"\u308a", ru:"\u308b", re:"\u308c", ro:"\u308d", xwa:"\u308e", lwa:"\u308e", wa:"\u308f", wi:"\u3046\u3043", we:"\u3046\u3047", wo:"\u3092", wha:"\u3046\u3041", whi:"\u3046\u3043", 
whu:"\u3046", whe:"\u3046\u3047", who:"\u3046\u3049", "z/":"\u30fb", "z.":"\u2026", "z,":"\u2025", zh:"\u2190", zj:"\u2193", zk:"\u2191", zl:"\u2192", "z-":"\u301c", "z[":"\u300e", "z]":"\u300f", "0":"\uff10", 1:"\uff11", 2:"\uff12", 3:"\uff13", 4:"\uff14", 5:"\uff15", 6:"\uff16", 7:"\uff17", 8:"\uff18", 9:"\uff19", "'":"\u2019", '"':"\u201d", ",":"\u3001", ".":"\u3002", "[":"\u300c", "]":"\u300d", "~":"\u301c", "/":"\u30fb", "-":"\u30fc", "!":"\uff01", "#":"\uff03", $:"\uff04", "%":"\uff05", "&":"\uff06", 
"(":"\uff08", ")":"\uff09", "*":"\uff0a", "+":"\uff0b", ":":"\uff1a", ";":"\uff1b", "<":"\uff1c", "=":"\uff1d", ">":"\uff1e", "?":"\uff1f", "@":"\uff20", "^":"\uff3e", _:"\uff3f", "`":"\uff40", "{":"\uff5b", "|":"\uff5c", "}":"\uff5d", "\\":"\uffe5", "\u00a5":"\uffe5", " ":"\u3000"};
goog.ime.plugin.lang.StaticTransliterator.mapEthiopic = function $goog$ime$plugin$lang$StaticTransliterator$mapEthiopic$(str) {
  var charMappings = goog.ime.plugin.lang.StaticTransliterator.EthiopicCharMappings_;
  return str && charMappings[str]
};
goog.ime.plugin.lang.StaticTransliterator.mapArabic = function $goog$ime$plugin$lang$StaticTransliterator$mapArabic$(str) {
  var charMappings = goog.ime.plugin.lang.StaticTransliterator.RtlCharMappings_, prefixRegex = /^([aei]l) /i;
  return str && (charMappings[str] || str.replace(prefixRegex, "$1-"))
};
goog.ime.plugin.lang.StaticTransliterator.mapPersian = function $goog$ime$plugin$lang$StaticTransliterator$mapPersian$(str) {
  var charMappings = goog.ime.plugin.lang.StaticTransliterator.RtlCharMappings_;
  return str && charMappings[str]
};
goog.ime.plugin.lang.StaticTransliterator.mapUrdu = function $goog$ime$plugin$lang$StaticTransliterator$mapUrdu$(str) {
  var charMappings = goog.ime.plugin.lang.StaticTransliterator.RtlCharMappings_;
  return str && charMappings[str]
};
goog.ime.plugin.lang.StaticTransliterator.mapBengali = function $goog$ime$plugin$lang$StaticTransliterator$mapBengali$(str) {
  var charMappings = goog.ime.plugin.lang.StaticTransliterator.BengaliCharMappings_;
  return str && charMappings[str]
};
goog.ime.plugin.lang.StaticTransliterator.mapIndic = function $goog$ime$plugin$lang$StaticTransliterator$mapIndic$(str) {
  var charMappings = goog.ime.plugin.lang.StaticTransliterator.IndicCharMappings_;
  return str && charMappings[str]
};
goog.ime.plugin.lang.StaticTransliterator.mapChinese = function $goog$ime$plugin$lang$StaticTransliterator$mapChinese$(ch, isSBC, isChinesePunctuation) {
  if(!ch) {
    return""
  }
  var lang = goog.ime.plugin.lang.StaticTransliterator, mappedChar = "";
  isChinesePunctuation && isSBC ? mappedChar = lang.ChinesePunctuationSBCMappings_[ch] : isChinesePunctuation && !isSBC ? mappedChar = lang.ChinesePunctuationDBCMappings_[ch] : !isChinesePunctuation && !isSBC && (mappedChar = lang.EnglishPunctuationDBCMappings_[ch]);
  !mappedChar && !isSBC && (mappedChar = lang.ChineseCharMappings_[ch]);
  if(!mappedChar && isChinesePunctuation) {
    var mapping = lang.ChineseAlternatingCharMappings_[ch];
    if(mapping) {
      var mappingIndex = mapping[0].indexOf(mapping[1]), mappedChar = mapping[1] = mapping[0].charAt((mappingIndex + 1) % mapping.length)
    }
  }
  return mappedChar || ch
};
goog.ime.plugin.lang.StaticTransliterator.mapSimplifiedChinese = function $goog$ime$plugin$lang$StaticTransliterator$mapSimplifiedChinese$(ch, isSBC, isChinesePunctuation) {
  var obj = goog.ime.plugin.lang.StaticTransliterator;
  return obj.mapChinese(ch, isSBC, isChinesePunctuation)
};
goog.ime.plugin.lang.StaticTransliterator.mapTraditionalChinese = function $goog$ime$plugin$lang$StaticTransliterator$mapTraditionalChinese$(ch, isSBC, isChinesePunctuation) {
  var obj = goog.ime.plugin.lang.StaticTransliterator;
  return obj.mapChinese(ch, isSBC, isChinesePunctuation)
};
var JSCompiler_temp_const$$4 = goog.ime.plugin.lang.StaticTransliterator, JSCompiler_inline_result$$105, result$$inline_106 = new goog.structs.StringSet, key$$inline_107;
for(key$$inline_107 in goog.ime.plugin.lang.StaticTransliterator.JapaneseMapping_) {
  for(var i$$inline_108 = 0, l$$inline_109 = key$$inline_107.length;i$$inline_108 < l$$inline_109;++i$$inline_108) {
    result$$inline_106.add(key$$inline_107.charAt(i$$inline_108))
  }
}
JSCompiler_inline_result$$105 = result$$inline_106;
JSCompiler_temp_const$$4.romajiCharSet_ = JSCompiler_inline_result$$105;
goog.ime.plugin.lang.StaticTransliterator.LONGEST_SINGLE_ROMAJI_LENGTH_ = 4;
goog.ime.plugin.lang.StaticTransliterator.rewriteRomajiQuery = function $goog$ime$plugin$lang$StaticTransliterator$rewriteRomajiQuery$(query) {
  var stl = goog.ime.plugin.lang.StaticTransliterator;
  if(stl.isRomajiInAlphabetMode(query)) {
    return query
  }
  for(var len = Math.min(query.length, stl.LONGEST_SINGLE_ROMAJI_LENGTH_);0 < len;--len) {
    var mappedValue = stl.JapaneseMapping_[query.slice(-len)];
    if(mappedValue) {
      return stl.applyRomajiSingleNRule(query.slice(0, -len), mappedValue)
    }
  }
  return stl.applyRomajiSingleNRule(query.slice(0, -1), query.slice(-1))
};
goog.ime.plugin.lang.StaticTransliterator.applyRomajiSingleNRule = function $goog$ime$plugin$lang$StaticTransliterator$applyRomajiSingleNRule$(str, followingStr) {
  var stl = goog.ime.plugin.lang.StaticTransliterator;
  return("n" == str.slice(-1) && "y" != followingStr ? str.slice(0, -1) + stl.JapaneseMapping_.nn : str) + followingStr
};
goog.ime.plugin.lang.StaticTransliterator.isRomajiInAlphabetMode = function $goog$ime$plugin$lang$StaticTransliterator$isRomajiInAlphabetMode$(str) {
  return/[A-Z]/.test(str)
};
goog.ime.plugin.lang.StaticTransliterator.isValidRomajiChar = function $goog$ime$plugin$lang$StaticTransliterator$isValidRomajiChar$(ch) {
  return goog.ime.plugin.lang.StaticTransliterator.romajiCharSet_.contains(ch)
};
goog.ime.plugin.lang.StaticTransliterator.prototype.getNativeNumber = function $goog$ime$plugin$lang$StaticTransliterator$$getNativeNumber$(index, langCodePair) {
  for(var stringbuffer = [], i = 0;i < index.length;i++) {
    var digit = index.charAt(i);
    stringbuffer[i] = this.get(langCodePair, digit).getDefault()
  }
  return stringbuffer.join("")
};
goog.ime.plugin.lang.StaticTransliterator.getDefault = function $goog$ime$plugin$lang$StaticTransliterator$getDefault$() {
  if(goog.ime.plugin.lang.StaticTransliterator.defaultTransliterator_) {
    return goog.ime.plugin.lang.StaticTransliterator.defaultTransliterator_
  }
  var transliterator = new goog.ime.plugin.lang.StaticTransliterator, en_am = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.AMHARIC);
  transliterator.register(en_am, goog.ime.plugin.lang.StaticTransliterator.mapEthiopic);
  var en_ar = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.ARABIC);
  transliterator.register(en_ar, goog.ime.plugin.lang.StaticTransliterator.mapArabic);
  var en_zh = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.SIMPLIFIED_CHINESE);
  transliterator.register(en_zh, goog.ime.plugin.lang.StaticTransliterator.mapSimplifiedChinese);
  var en_zh_hant = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.TRADITIONAL_CHINESE);
  transliterator.register(en_zh_hant, goog.ime.plugin.lang.StaticTransliterator.mapTraditionalChinese);
  var en_fa = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.PERSIAN);
  transliterator.register(en_fa, goog.ime.plugin.lang.StaticTransliterator.mapPersian);
  var en_ti = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.TIGRINYA);
  transliterator.register(en_ti, goog.ime.plugin.lang.StaticTransliterator.mapEthiopic);
  var en_ur = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.URDU);
  transliterator.register(en_ur, goog.ime.plugin.lang.StaticTransliterator.mapUrdu);
  var en_bn = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.BENGALI);
  transliterator.register(en_bn, goog.ime.plugin.lang.StaticTransliterator.mapBengali);
  var en_gu = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.GUJARATI);
  transliterator.register(en_gu, goog.ime.plugin.lang.StaticTransliterator.mapIndic);
  var en_hi = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.HINDI);
  transliterator.register(en_hi, goog.ime.plugin.lang.StaticTransliterator.mapIndic);
  var en_mara = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.MARATHI);
  transliterator.register(en_mara, goog.ime.plugin.lang.StaticTransliterator.mapIndic);
  var en_ne = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.NEPALI);
  transliterator.register(en_ne, goog.ime.plugin.lang.StaticTransliterator.mapIndic);
  var en_pu = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.PUNJABI);
  transliterator.register(en_pu, goog.ime.plugin.lang.StaticTransliterator.mapIndic);
  return goog.ime.plugin.lang.StaticTransliterator.defaultTransliterator_ = transliterator
};
goog.ime.plugin.lang.JapanesePluginProxy = function $goog$ime$plugin$lang$JapanesePluginProxy$() {
  goog.ime.ui.PluginProxy.call(this, goog.ime.plugin.lang.JapanesePluginProxy.defaultKeyBindings_)
};
goog.inherits(goog.ime.plugin.lang.JapanesePluginProxy, goog.ime.ui.PluginProxy);
goog.ime.plugin.lang.JapanesePluginProxy.defaultKeyBindings_ = {commit:[goog.events.KeyCodes.ENTER], revert:[goog.events.KeyCodes.BACKSPACE], query:[goog.events.KeyCodes.SPACE, goog.events.KeyCodes.DOWN, goog.events.KeyCodes.TAB]};
goog.ime.plugin.lang.JapanesePluginProxy.prototype.handleQueryKey = function $goog$ime$plugin$lang$JapanesePluginProxy$$handleQueryKey$(editor, e) {
  var editorText = editor.getEditorText(), splitText = this.splitEditorText_(editor);
  e.keyCode == goog.events.KeyCodes.SPACE && !splitText.right && " " == splitText.left.slice(-1) && this.inAlphabetMode_(splitText.left) && (editorText = editorText.slice(0, -1), editor.setEditorText(editorText));
  !splitText.right && "n" == splitText.left.slice(-1) && !this.inAlphabetMode_(splitText.left) && (editorText = goog.ime.plugin.lang.StaticTransliterator.applyRomajiSingleNRule(editorText, ""), editor.setEditorText(editorText));
  editor.dispatchEvent(new goog.ime.ui.FetchMultiSegmentSuggestionEvent([editorText], 1, !0));
  return!0
};
goog.ime.plugin.lang.JapanesePluginProxy.prototype.handleValidCharKeyInternal = function $goog$ime$plugin$lang$JapanesePluginProxy$$handleValidCharKeyInternal$(editor, e, ch) {
  var splitText = this.splitEditorText_(editor), stl = goog.ime.plugin.lang.StaticTransliterator, newText = stl.rewriteRomajiQuery(splitText.left + ch) + splitText.right;
  editor.setEditorText(newText);
  editor.setCaret(newText.length - splitText.right.length);
  return!0
};
goog.ime.plugin.lang.JapanesePluginProxy.prototype.isQueryKey = function $goog$ime$plugin$lang$JapanesePluginProxy$$isQueryKey$(editor, e) {
  if(e.keyCode == goog.events.KeyCodes.SPACE && editor.inCompositionState()) {
    var splitText = this.splitEditorText_(editor);
    if(this.inAlphabetMode_(splitText.left)) {
      return!splitText.right && " " == splitText.left.slice(-1)
    }
  }
  return goog.ime.plugin.lang.JapanesePluginProxy.superClass_.isQueryKey.call(this, editor, e)
};
goog.ime.plugin.lang.JapanesePluginProxy.prototype.isValidCharKeyInternal = function $goog$ime$plugin$lang$JapanesePluginProxy$$isValidCharKeyInternal$(editor, e, ch) {
  return(e.altKey || e.ctrlKey || e.metaKey) && "\u00a5" != ch ? !1 : e.keyCode == goog.events.KeyCodes.SPACE ? this.inAlphabetMode_(this.splitEditorText_(editor).left) ? !0 : !1 : this.isValidChar(ch)
};
goog.ime.plugin.lang.JapanesePluginProxy.prototype.isValidChar = function $goog$ime$plugin$lang$JapanesePluginProxy$$isValidChar$(ch) {
  return goog.ime.plugin.lang.StaticTransliterator.isValidRomajiChar(ch.toLowerCase())
};
goog.ime.plugin.lang.JapanesePluginProxy.prototype.splitEditorText_ = function $goog$ime$plugin$lang$JapanesePluginProxy$$splitEditorText_$(editor) {
  var text = editor.getEditorText(), caret = editor.getCaret(), offset = caret ? caret.getStartOffset() : text.length;
  return{left:text.substring(0, offset), right:text.substring(offset)}
};
goog.ime.plugin.lang.JapanesePluginProxy.prototype.inAlphabetMode_ = function $goog$ime$plugin$lang$JapanesePluginProxy$$inAlphabetMode_$(str) {
  return goog.ime.plugin.lang.StaticTransliterator.isRomajiInAlphabetMode(str)
};
goog.ime.plugin.lang.JapanesePluginProxy.prototype.getMappingChar = function $goog$ime$plugin$lang$JapanesePluginProxy$$getMappingChar$(inputTool, e) {
  var ch = String.fromCharCode(e.charCode);
  if(" " == ch && !e.shiftKey && !e.altKey && !e.ctrlKey && !e.metaKey) {
    var transliterator = goog.ime.plugin.lang.StaticTransliterator.getDefault();
    return transliterator.getMappingChar(inputTool, ch)
  }
  return""
};
goog.ime.plugin.lang.MultiSegmentPopupEditor = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$(dom, opt_renderer) {
  goog.ime.ui.CustomPopupMenu.call(this, dom, opt_renderer, []);
  this.pageSize_ = 5;
  this.currentStart_ = 0;
  this.disableHover_ = this.isForcedHide_ = !1;
  this.pluginProxy_ = new goog.ime.plugin.lang.JapanesePluginProxy;
  this.editorCommandsForComposition_ = this.buildEditorCommandTableForComposition_();
  this.editorCommandsForConversion_ = this.buildEditorCommandTableForConversion_();
  this.editorChangeHistory_ = {};
  this.liveEditorChangeHistory_ = [];
  this.state_ = goog.ime.plugin.lang.MultiSegmentPopupEditor.STATE.COMPOSITION;
  this.segments_ = [];
  this.selectedSegment_ = 0;
  this.canFetchMore_ = !0;
  this.cursorPos = 0;
  this.textInput_ = this.rightTextSpan_ = this.leftTextSpan_ = this.cursorSpan_ = null
};
goog.inherits(goog.ime.plugin.lang.MultiSegmentPopupEditor, goog.ime.ui.CustomPopupMenu);
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.logger = goog.debug.Logger.getLogger("goog.ime.plugin.lang.MultiSegmentPopupEditor");
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.createDom = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$createDom$() {
  goog.ime.plugin.lang.MultiSegmentPopupEditor.superClass_.createDom.call(this);
  var dom = this.getDomHelper(), element = this.getElement(), editorCss = this.getRenderer().getCssClass(), tableCss = editorCss + "-table", containerTable = goog.dom.createTable(1, 1);
  goog.dom.classes.add(containerTable, tableCss);
  var cellCss = editorCss + "-td", containerCell = containerTable.rows[0].cells[0];
  goog.dom.classes.add(containerCell, cellCss);
  var inputCss = editorCss + "-input";
  this.textEditorElement_ = dom.createDom("div", inputCss);
  this.leftTextSpan_ = goog.dom.createDom("span");
  goog.dom.setTextContent(this.leftTextSpan_, "");
  dom.appendChild(this.textEditorElement_, this.leftTextSpan_);
  this.cursorSpan_ = goog.dom.createDom("span", editorCss + "-cursor");
  dom.appendChild(this.textEditorElement_, this.cursorSpan_);
  this.rightTextSpan_ = goog.dom.createDom("span");
  goog.dom.setTextContent(this.rightTextSpan_, "");
  dom.appendChild(this.textEditorElement_, this.rightTextSpan_);
  dom.appendChild(containerCell, this.textEditorElement_);
  this.contentElement_ = dom.createDom("div", editorCss + "-content");
  dom.appendChild(containerCell, this.contentElement_);
  var footerCss = editorCss + "-footer", footerCell = goog.dom.createDom("div", footerCss), logoCss = editorCss + "-logo";
  dom.appendChild(footerCell, dom.createDom("div", logoCss));
  var indicatorCss = editorCss + "-indicator";
  this.suggestionIndicatorElement_ = dom.createDom("div", indicatorCss);
  dom.appendChild(footerCell, this.suggestionIndicatorElement_);
  var footerEndCss = editorCss + "-footer-end";
  dom.appendChild(footerCell, dom.createDom("div", footerEndCss));
  dom.appendChild(containerCell, footerCell);
  dom.appendChild(element, containerTable)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.enterDocument = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$enterDocument$() {
  goog.ime.plugin.lang.MultiSegmentPopupEditor.superClass_.enterDocument.call(this);
  this.addEventListener(goog.ui.Component.EventType.HIDE, this.onHide_, !1, this);
  this.addEventListener(goog.ui.Component.EventType.ENTER, this.onEnter_, !1, this);
  this.addEventListener(goog.ui.Component.EventType.ACTION, this.onActionEvent_, !1, this);
  this.setVisible(!1, !0);
  this.setFocusableChildrenAllowed(!1);
  this.setFocusable(!1)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.getContentElement = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$getContentElement$() {
  return this.contentElement_ || goog.ime.plugin.lang.MultiSegmentPopupEditor.superClass_.getContentElement.call(this)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.handleChildMouseEvents = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$handleChildMouseEvents$(e) {
  var retVal = goog.ime.plugin.lang.MultiSegmentPopupEditor.superClass_.handleChildMouseEvents.call(this, e);
  this.textInput_ && this.containsElement(document.activeElement) && this.textInput_.setFocus();
  return retVal
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.highlightNext = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$highlightNext$() {
  var highlightedIndex = this.getHighlightedIndex();
  0 > highlightedIndex || highlightedIndex >= this.getChildCount() - 1 ? this.flipPageMovingBy_(1) : (goog.ime.plugin.lang.MultiSegmentPopupEditor.superClass_.highlightNext.call(this), this.segments_[this.selectedSegment_].selected = this.currentStart_ + this.getHighlightedIndex(), this.showComposition_())
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.highlightPrevious = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$highlightPrevious$() {
  0 >= this.getHighlightedIndex() ? this.flipPageMovingBy_(-1) : (goog.ime.plugin.lang.MultiSegmentPopupEditor.superClass_.highlightPrevious.call(this), this.segments_[this.selectedSegment_].selected = this.currentStart_ + this.getHighlightedIndex(), this.showComposition_())
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.handleKeyEventInternal = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$handleKeyEventInternal$(e) {
  if(!this.pluginProxy_) {
    return!1
  }
  var handled = this.inCompositionState() && this.handleKeyEventInComposition_(e) || this.inConversionState() && this.handleKeyEventInConversion_(e);
  !handled && !e.ctrlKey && !e.metaKey && !e.altKey && (handled = this.invokeEditorCommand_(e));
  handled && this.inCompositionState() && !this.getEditorText() && this.commitEditorText(!1);
  return!0
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.ignoreEvent = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$ignoreEvent$(e) {
  return!!e.charCode && !this.pluginProxy_.isValidCharKey(this, e)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.onDocClick = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$onDocClick$(e) {
  this.isVisible() && !this.containsElement(e.target) && this.commitEditorText(!0)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.handleKeyDownForShortCutKeys = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$handleKeyDownForShortCutKeys$(e) {
  return this.onStage() && (e.ctrlKey || e.metaKey || e.altKey) && this.invokeEditorCommand_(e) ? (this.inCompositionState() && !this.getEditorText() && this.commitEditorText(!1), e.preventDefault(), e.stopPropagation(), !0) : !1
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.handleKeyEventInComposition_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$handleKeyEventInComposition_$(e) {
  var m = "handleKeyEventInComposition_:";
  if(this.pluginProxy_.isQueryKey(this, e)) {
    return this.pluginProxy_.handleQueryKey(this, e) && (0 == this.segments_.length && (this.segments_ = [new goog.ime.plugin.lang.MultiSegmentPopupEditor.Segment_(this.getEditorText())], this.selectedSegment_ = 0), this.state_ = goog.ime.plugin.lang.MultiSegmentPopupEditor.STATE.CONVERSION, this.setCaret(!0), this.reshowSuggestions()), !0
  }
  if(this.pluginProxy_.isRevertKey(this, e)) {
    var isBackspace = e.keyCode == goog.events.KeyCodes.BACKSPACE;
    if(isBackspace && this.revertLiveHistory_() || this.revertHistory_(isBackspace)) {
      return this.logger.info(m + "history:" + this.getEditorText()), !0
    }
  }
  return this.pluginProxy_.isValidCharKey(this, e) ? this.pluginProxy_.handleValidCharKey(this, e) : !1
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.handleKeyEventInConversion_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$handleKeyEventInConversion_$(e) {
  var m = "handleKeyEventInConversion_:";
  if(this.pluginProxy_.isValidCharKey(this, e)) {
    var str = String.fromCharCode(e.charCode), isNumeric = goog.string.isNumeric(str);
    this.logger.fine(m + "Number:" + str + ":" + e.charCode + ":" + isNumeric);
    if(isNumeric) {
      var num = goog.string.toNumber(str);
      if(1 <= num && 9 >= num && this.selectSuggestion_(num - 1)) {
        return!0
      }
    }
    return this.commitEditorTextWithFollowingEvent_(!0, e)
  }
  return!1
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.buildEditorCommandTableForComposition_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$buildEditorCommandTableForComposition_$() {
  var Key = goog.events.KeyCodes, CTRL = Key.CTRL;
  return this.buildEditorCommandTable_([[Key.LEFT, this.editorCommandMoveCursorLeft_], [Key.RIGHT, this.editorCommandMoveCursorRight_], [Key.HOME, this.editorCommandMoveCursorToBeginning_], [Key.END, this.editorCommandMoveCursorToEnd_], [Key.BACKSPACE, this.editorCommandBackspace_], [Key.DELETE, this.editorCommandDelete_], [Key.ENTER, this.editorCommandCommit_], [Key.ESC, this.editorCommandCancel_], [CTRL, Key.B, this.editorCommandMoveCursorLeft_], [CTRL, Key.F, this.editorCommandMoveCursorRight_], 
  [CTRL, Key.A, this.editorCommandMoveCursorToBeginning_], [CTRL, Key.E, this.editorCommandMoveCursorToEnd_], [CTRL, Key.H, this.editorCommandBackspace_], [CTRL, Key.D, this.editorCommandDelete_], [CTRL, Key.M, this.editorCommandCommit_], [CTRL, Key.G, this.editorCommandCancel_]])
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.buildEditorCommandTableForConversion_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$buildEditorCommandTableForConversion_$() {
  var Key = goog.events.KeyCodes, SHIFT = Key.SHIFT, CTRL = Key.CTRL;
  return this.buildEditorCommandTable_([[Key.LEFT, this.editorCommandSegmentFocusLeft_], [Key.RIGHT, this.editorCommandSegmentFocusRight_], [Key.UP, this.editorCommandConvertPrev_], [Key.DOWN, this.editorCommandConvertNext_], [Key.PAGE_UP, this.editorCommandConvertPrevPage_], [Key.PAGE_DOWN, this.editorCommandConvertNextPage_], [Key.HOME, this.editorCommandConvertFirst_], [Key.END, this.editorCommandConvertLast_], [Key.ENTER, this.editorCommandCommit_], [Key.ESC, this.editorCommandCancel_], [Key.BACKSPACE, 
  this.editorCommandCancel_], [Key.TAB, this.editorCommandConvertNext_], [Key.SPACE, this.editorCommandConvertNext_], [SHIFT, Key.SPACE, this.editorCommandConvertPrev_], [SHIFT, Key.LEFT, this.editorCommandSegmentWidthShrink_], [SHIFT, Key.RIGHT, this.editorCommandSegmentWidthExpand_], [SHIFT, Key.UP, this.editorCommandConvertPrevPage_], [SHIFT, Key.DOWN, this.editorCommandConvertNextPage_], [CTRL, Key.B, this.editorCommandSegmentFocusLeft_], [CTRL, Key.F, this.editorCommandSegmentFocusRight_], [CTRL, 
  Key.P, this.editorCommandConvertPrev_], [CTRL, Key.N, this.editorCommandConvertNext_], [CTRL, Key.A, this.editorCommandSegmentFocusFirst_], [CTRL, Key.E, this.editorCommandSegmentFocusLast_], [CTRL, Key.I, this.editorCommandSegmentWidthShrink_], [CTRL, Key.O, this.editorCommandSegmentWidthExpand_], [CTRL, Key.Q, this.editorCommandSegmentWidthShrink_], [CTRL, Key.W, this.editorCommandSegmentWidthExpand_], [CTRL, Key.M, this.editorCommandCommit_], [CTRL, Key.H, this.editorCommandCancel_], [CTRL, 
  Key.G, this.editorCommandCancel_]])
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.buildEditorCommandTable_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$buildEditorCommandTable_$(keyBindingEntries) {
  var editorCommandTable = {}, Key = goog.events.KeyCodes, Modifiers = [Key.SHIFT, Key.CTRL, Key.META, Key.ALT];
  goog.array.forEach(keyBindingEntries, function(entry) {
    var shiftKey = goog.array.contains(entry, Key.SHIFT), ctrlKey = goog.array.contains(entry, Key.CTRL), metaKey = goog.array.contains(entry, Key.META), altKey = goog.array.contains(entry, Key.ALT), keyCode = goog.array.find(entry, function(key) {
      return goog.isNumber(key) && !goog.array.contains(Modifiers, key)
    }), command = goog.array.find(entry, goog.isFunction), commandKey = this.makeEditorCommandKey_(keyCode, shiftKey, ctrlKey, metaKey, altKey);
    editorCommandTable[commandKey] = command
  }, this);
  return editorCommandTable
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.invokeEditorCommand_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$invokeEditorCommand_$(e) {
  var key = this.makeEditorCommandKey_(e.keyCode, e.shiftKey, e.ctrlKey, e.metaKey, e.altKey), command = this.inCompositionState() ? this.editorCommandsForComposition_[key] : this.editorCommandsForConversion_[key];
  if(command) {
    var result = command.call(this, e);
    return goog.isBoolean(result) ? result : !0
  }
  return!1
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.makeEditorCommandKey_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$makeEditorCommandKey_$(keyCode, shiftKey, ctrlKey, metaKey, altKey) {
  return keyCode + ((shiftKey ? 1024 : 0) + (ctrlKey ? 2048 : 0) + (metaKey ? 4096 : 0) + (altKey ? 8192 : 0))
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandCommit_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandCommit_$() {
  this.commitEditorText(!0)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandCancel_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandCancel_$() {
  this.inCompositionState() ? this.commitEditorText(!1) : this.clearSuggestions()
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandMoveCursorLeft_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandMoveCursorLeft_$() {
  this.setCaret(this.getCaret().getStartOffset() - 1)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandMoveCursorRight_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandMoveCursorRight_$() {
  this.setCaret(this.getCaret().getStartOffset() + 1)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandMoveCursorToBeginning_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandMoveCursorToBeginning_$() {
  this.setCaret(!0)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandMoveCursorToEnd_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandMoveCursorToEnd_$() {
  this.setCaret(!1)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandBackspace_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandBackspace_$() {
  var text = this.getEditorText(), offset = this.getCaret().getStartOffset();
  0 >= offset || (this.setEditorText(text.substring(0, offset - 1) + text.substring(offset)), this.setCaret(offset - 1))
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandDelete_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandDelete_$() {
  var text = this.getEditorText(), offset = this.getCaret().getStartOffset();
  offset >= text.length || (this.setEditorText(text.substring(0, offset) + text.substring(offset + 1)), this.setCaret(offset))
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandConvertNext_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandConvertNext_$() {
  this.highlightNext()
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandConvertPrev_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandConvertPrev_$() {
  this.highlightPrevious()
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandConvertNextPage_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandConvertNextPage_$() {
  this.flipPageMovingBy_(this.pageSize_)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandConvertPrevPage_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandConvertPrevPage_$() {
  this.flipPageMovingBy_(-this.pageSize_)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandConvertFirst_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandConvertFirst_$() {
  this.showSuggestionsAround(0)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandConvertLast_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandConvertLast_$() {
  this.showSuggestionsAround(this.segments_[this.selectedSegment_].suggestions.length - 1)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandSegmentFocusLeft_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandSegmentFocusLeft_$() {
  this.selectedSegment_ = goog.math.modulo(this.selectedSegment_ - 1, this.segments_.length);
  this.reshowSuggestions()
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandSegmentFocusRight_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandSegmentFocusRight_$() {
  this.selectedSegment_ = goog.math.modulo(this.selectedSegment_ + 1, this.segments_.length);
  this.reshowSuggestions()
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandSegmentFocusFirst_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandSegmentFocusFirst_$() {
  this.selectedSegment_ = 0;
  this.reshowSuggestions()
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandSegmentFocusLast_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandSegmentFocusLast_$() {
  this.selectedSegment_ = Math.max(0, this.segments_.length - 1);
  this.reshowSuggestions()
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandSegmentWidthShrink_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandSegmentWidthShrink_$() {
  this.shrinkSegment_(this.selectedSegment_) && (this.reshowSuggestions(), this.canFetchMore_ = this.dispatchEvent(new goog.ime.ui.FetchMultiSegmentSuggestionEvent(this.getQueriedSegments_(), 1)))
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.editorCommandSegmentWidthExpand_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$editorCommandSegmentWidthExpand_$() {
  this.expandSegment_(this.selectedSegment_) && (this.reshowSuggestions(), this.canFetchMore_ = this.dispatchEvent(new goog.ime.ui.FetchMultiSegmentSuggestionEvent(this.getQueriedSegments_(), 1)))
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.selectSuggestion_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$selectSuggestion_$(index) {
  var m = "selectSuggestion_:", selected = this.currentStart_ + index, segment = this.segments_[this.selectedSegment_];
  if(!(0 <= selected && selected < segment.suggestions.length)) {
    return this.logger.warning(m + "Invalid index:" + index), !1
  }
  segment.selected = selected;
  this.setHighlightedIndex(index);
  this.showComposition_();
  return!0
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.flipPageMovingBy_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$flipPageMovingBy_$(diff) {
  var m = "flipPageMovingBy_:", suggestions = this.segments_[this.selectedSegment_].suggestions;
  if(0 != suggestions.length) {
    var newIndex = this.segments_[this.selectedSegment_].selected + diff;
    0 > newIndex && (newIndex = suggestions.length - 1);
    var requiredSize = (Math.floor(newIndex / this.pageSize_) + 2) * this.pageSize_;
    requiredSize >= suggestions.length && (this.moreSuggestionsAvailableForCurrentSegment_() && (this.canFetchMore_ = this.dispatchEvent(new goog.ime.ui.FetchMultiSegmentSuggestionEvent(this.getQueriedSegments_(), suggestions.length + 1))), this.logger.info(m + "More suggestions to fetch:" + this.moreSuggestionsAvailableForCurrentSegment_()));
    if(suggestions.length <= newIndex) {
      if(this.moreSuggestionsAvailableForCurrentSegment_()) {
        return
      }
      newIndex = 0
    }
    this.showSuggestionsAround(newIndex)
  }
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.expandSegment_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$expandSegment_$(index) {
  if(index + 1 >= this.segments_.length) {
    return!1
  }
  var segment = this.segments_[index].inputText, nextSegment = this.segments_[index + 1].inputText, firstChar = nextSegment.substring(0, 1);
  this.segments_[index] = new goog.ime.plugin.lang.MultiSegmentPopupEditor.Segment_(segment + firstChar);
  1 >= nextSegment.length ? goog.array.removeAt(this.segments_, index + 1) : this.segments_[index + 1] = new goog.ime.plugin.lang.MultiSegmentPopupEditor.Segment_(nextSegment.substring(1));
  return!0
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.shrinkSegment_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$shrinkSegment_$(index) {
  var segment = this.segments_[index].inputText;
  if(1 >= segment.length) {
    return!1
  }
  var lastChar = segment.substring(segment.length - 1);
  this.segments_[index] = new goog.ime.plugin.lang.MultiSegmentPopupEditor.Segment_(segment.substring(0, segment.length - 1));
  index >= this.segments_.length - 1 ? this.segments_.push(new goog.ime.plugin.lang.MultiSegmentPopupEditor.Segment_(lastChar)) : this.segments_[index + 1] = new goog.ime.plugin.lang.MultiSegmentPopupEditor.Segment_(lastChar + this.segments_[index + 1].inputText);
  return!0
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.onEnter_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$onEnter_$(e) {
  this.disableHover_ && e.preventDefault()
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.onHide_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$onHide_$() {
  this.logger.info("Hide event forced: " + this.isForcedHide_);
  return this.isForcedHide_
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.onActionEvent_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$onActionEvent_$(e) {
  var index;
  return e.target instanceof goog.ui.MenuItem && 0 <= (index = this.indexOfChild(e.target)) ? this.selectSuggestion_(index) : !1
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.temporarilyDisableHover_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$temporarilyDisableHover_$() {
  this.disableHover_ = !0;
  goog.Timer.callOnce(function() {
    this.disableHover_ = !1
  }, 0, this)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.forceHide_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$forceHide_$() {
  this.isForcedHide_ = !0;
  this.hide();
  this.isForcedHide_ = !1
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.consumeEvent_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$consumeEvent_$(e) {
  e.stopPropagation();
  e.preventDefault();
  return!0
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.onStage = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$onStage$() {
  return this.isInDocument() && this.isVisible()
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.getEditableElement = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$getEditableElement$() {
  return this.textEditorElement_
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.setPageSize = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$setPageSize$(pageSize) {
  var m = "setPageSize:";
  1 > pageSize ? this.logger.warning(m + "Invalid page size:" + pageSize) : this.pageSize_ = pageSize
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.getCaret = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$getCaret$() {
  return goog.dom.Range.createCaret(this.textEditorElement_, this.cursorPos)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.setCaret = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$setCaret$(offset) {
  var text = goog.dom.getRawTextContent(this.leftTextSpan_) + goog.dom.getRawTextContent(this.rightTextSpan_), textLength = text.length, offsetIndex = goog.isBoolean(offset) ? offset ? 0 : textLength : offset, offsetIndex = goog.math.clamp(offsetIndex, 0, textLength);
  if(offsetIndex != this.cursorPos) {
    var leftText = text.slice(0, offsetIndex);
    goog.dom.setTextContent(this.leftTextSpan_, leftText);
    var rightText = text.slice(offsetIndex);
    goog.dom.setTextContent(this.rightTextSpan_, rightText);
    this.cursorPos = offsetIndex
  }
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.getQueryText = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$getQueryText$() {
  return this.inConversionState() ? this.getQueriedSegments_().join(",") : (goog.dom.getRawTextContent(this.textEditorElement_) || "").replace(/\u00a0/g, " ")
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.getEditorText = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$getEditorText$() {
  return this.inConversionState() ? this.getSelectedSegments_().join("") : (goog.dom.getRawTextContent(this.leftTextSpan_) + goog.dom.getRawTextContent(this.rightTextSpan_) || "").replace(/\u00a0/g, " ")
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.setEditorText = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$setEditorText$(text) {
  var m = "setEditorText:";
  this.inConversionState() ? this.logger.warning(m + "must not be called while not in the composition state.") : (this.clearEditorText_(), goog.dom.setTextContent(this.leftTextSpan_, text.replace(/ /g, "\u00a0")), this.cursorPos = text.length, this.isVisible() && this.setCaret(!1))
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.modifyEditorText = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$modifyEditorText$(oldText, newText) {
  var m = "modifyEditorText:";
  this.logger.info(m + "oldText:" + oldText + ":newText:" + newText);
  if(this.inCompositionState()) {
    if(oldText != newText) {
      var range = this.getCaret(), node = range.getStartNode(), offset = range.getStartOffset(), editorText = this.getEditorText(), oldIndex = editorText.indexOf(oldText);
      this.logger.info(m + ["editorText", editorText, "offset", offset].join(":"));
      if(!editorText && !oldText && newText) {
        this.setEditorText(newText)
      }else {
        if(0 <= oldIndex) {
          var newEditorText = editorText.replace(oldText, newText);
          node.nodeValue = newEditorText;
          this.disableSuggestions();
          var moveCaret = oldIndex + oldText.length > offset, newOffset = offset + newText.length - (moveCaret ? 0 : oldText.length);
          this.recordHistory_(oldText, newText, oldIndex + newText.length);
          this.setCaret(newOffset)
        }
      }
    }
  }else {
    this.logger.warning(m + "must not be called while not in the composition state.")
  }
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.commitEditorText = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$commitEditorText$(success) {
  return this.commitEditorTextWithFollowingEvent_(success, null)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.showErrorMessage = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$showErrorMessage$(msg, opt_style) {
  opt_style = opt_style || {background:"#ffa"};
  this.clearSuggestions();
  var msgMenuItem = this.addMenuItem(msg, "", void 0, opt_style);
  msgMenuItem.setEnabled(!1)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.setChildrenData = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$setChildrenData$(childrenData) {
  var m = "setChildrenData:";
  this.segments_ = [new goog.ime.plugin.lang.MultiSegmentPopupEditor.Segment_(this.getQueryText(), childrenData)];
  this.canFetchMore_ = !0;
  this.logger.info(m + "selected:" + this.getSelectedSegments_().join(","))
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.disableSuggestions = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$disableSuggestions$() {
  this.forEachChild(function(menuItem) {
    menuItem.setEnabled(!1)
  });
  this.setChildrenSegments([]);
  this.canFetchMore_ = !1
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.clearSuggestions = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$clearSuggestions$() {
  this.removeChildren(!0);
  var query = this.getQueriedSegments_().join("");
  this.setChildrenSegments([]);
  this.state_ = goog.ime.plugin.lang.MultiSegmentPopupEditor.STATE.COMPOSITION;
  this.setEditorText(query);
  this.clearIndicator_()
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.showFrom = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$showFrom$(start) {
  this.showSuggestionsAround(start)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.reset = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$reset$() {
  this.logger.info("Reset the popup editor");
  this.editorChangeHistory_ = {};
  this.liveEditorChangeHistory_ = [];
  this.clearSuggestions();
  this.setEditorText("")
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.revertLiveHistory_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$revertLiveHistory_$() {
  var m = "revertLiveHistory_:", caret = this.getCaret(), currentOffset = caret.getStartOffset();
  if(!this.liveEditorChangeHistory_ || goog.array.isEmpty(this.liveEditorChangeHistory_)) {
    return!1
  }
  var editRecord = goog.array.peek(this.liveEditorChangeHistory_);
  if(editRecord.editorText != this.getEditorText() || editRecord.queryText != this.getQueryText()) {
    return this.logger.info(m + "Clear live history"), this.liveEditorChangeHistory_ = [], !1
  }
  var newOffset = currentOffset + this.revertRecord_(editRecord, !0);
  this.setCaret(newOffset);
  return!0
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.revertHistory_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$revertHistory_$(caretAtEnd) {
  var caret = this.getCaret(), currentOffset = caret.getStartOffset(), editRecord = this.editorChangeHistory_[currentOffset];
  if(!editRecord) {
    return!1
  }
  var newOffset = currentOffset + this.revertRecord_(editRecord, caretAtEnd);
  this.setCaret(newOffset);
  return!0
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.revertRecord_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$revertRecord_$(editRecord, caretAtEnd) {
  var offset = editRecord.index;
  goog.array.remove(this.liveEditorChangeHistory_, editRecord);
  goog.object.remove(this.editorChangeHistory_, offset);
  var editorText = this.getEditorText(), newTextLength = editRecord.newText.length, oldTextLength = editRecord.oldText.length, newTextIndex = offset - newTextLength, currentTextAtCaret = editorText.substring(newTextIndex, offset);
  if(currentTextAtCaret != editRecord.newText) {
    return 0
  }
  var newText = editorText.substring(0, newTextIndex) + editRecord.oldText + editorText.substring(offset);
  this.setEditorText(newText);
  var offsetDiff = (caretAtEnd ? oldTextLength : 0) - newTextLength;
  return offsetDiff
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.recordHistory_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$recordHistory_$(oldText, newText, index) {
  this.liveEditorChangeHistory_.push(this.editorChangeHistory_[index] = {oldText:oldText, newText:newText, editorText:this.getEditorText(), queryText:this.getQueryText(), index:index})
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.inCompositionState = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$inCompositionState$() {
  return this.state_ == goog.ime.plugin.lang.MultiSegmentPopupEditor.STATE.COMPOSITION
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.inConversionState = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$inConversionState$() {
  return this.state_ == goog.ime.plugin.lang.MultiSegmentPopupEditor.STATE.CONVERSION
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.updateChildrenSegments = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$updateChildrenSegments$(segments) {
  var m = "updateChildrenSegments:", oldQuery = goog.array.map(this.segments_, function(segment) {
    return segment.inputText
  }), newQuery = goog.array.map(segments, function(segment) {
    return segment.getInput()
  });
  goog.array.equals(oldQuery, newQuery) ? (this.segments_ = goog.array.map(this.segments_, function(oldSegment, i) {
    var selected = oldSegment.suggestions[oldSegment.selected], newIndex = !selected ? 0 : goog.array.findIndex(segments[i].getSuggestions(), function(suggestion) {
      return suggestion.getText() == selected.getText()
    });
    return new goog.ime.plugin.lang.MultiSegmentPopupEditor.Segment_(segments[i].getInput(), segments[i].getSuggestions(), newIndex)
  }), this.canFetchMore_ = !0, this.logger.info(m + "selected:" + this.getSelectedSegments_().join(","))) : this.setChildrenSegments(segments)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.setChildrenSegments = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$setChildrenSegments$(segments) {
  var m = "setChildrenSegments:";
  this.segments_ = goog.array.map(segments, function(segment) {
    return new goog.ime.plugin.lang.MultiSegmentPopupEditor.Segment_(segment.getInput(), segment.getSuggestions())
  });
  this.selectedSegment_ = 0;
  this.canFetchMore_ = !0;
  this.logger.info(m + "selected:" + this.getSelectedSegments_().join(","))
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.reshowSuggestions = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$reshowSuggestions$() {
  this.showSuggestionsAround(this.segments_[this.selectedSegment_].selected)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.showSuggestionsAround = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$showSuggestionsAround$(index) {
  var m = "showSuggestionsAround:";
  if(0 > this.selectedSegment_ || this.segments_.length <= this.selectedSegment_) {
    this.logger.severe(m + "Invalid segment:this.selectedSegment_:" + this.selectedSegment_)
  }else {
    var suggestions = this.segments_[this.selectedSegment_].suggestions;
    1 > suggestions.length ? (this.logger.info(m + "There is no suggestions."), index = 0) : index = goog.math.clamp(index, 0, suggestions.length - 1);
    this.currentStart_ = Math.floor(index / this.pageSize_) * this.pageSize_;
    this.removeChildren(!0);
    for(var i = 0;i < this.pageSize_;i++) {
      var childIndex = this.currentStart_ + i;
      if(childIndex < suggestions.length) {
        var childData = suggestions[childIndex];
        this.addMenuItem(childData.getDisplayContent(i), childData)
      }
    }
    this.setHighlightedIndex(index - this.currentStart_);
    this.segments_[this.selectedSegment_].selected = index;
    this.temporarilyDisableHover_();
    this.showComposition_()
  }
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.showComposition_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$showComposition_$() {
  if(this.inConversionState()) {
    var dom = this.getDomHelper(), editorCss = this.getRenderer().getCssClass(), highlightedCss = editorCss + "-segment-highlighted", normalCss = editorCss + "-segment";
    dom.removeChildren(this.textEditorElement_);
    dom.append(this.textEditorElement_, goog.array.map(this.getSelectedSegments_(), function(segment, i) {
      var cssClass = i == this.selectedSegment_ ? highlightedCss : normalCss;
      return dom.createDom("span", cssClass, segment.replace(/ /g, "\u00a0"))
    }, this));
    this.updateIndicator_()
  }
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.commitEditorTextWithFollowingEvent_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$commitEditorTextWithFollowingEvent_$(success, followingEvent) {
  var m = "commitEditorTextWithFollowingKeyEvent_:";
  this.logger.info(m + "success:" + success);
  this.forceHide_();
  var event = new goog.events.Event(success ? goog.ime.ui.PopupEditor.EventType.SUCCESS : goog.ime.ui.PopupEditor.EventType.DISCARD, this);
  followingEvent && (event.followingEvent = followingEvent);
  return this.dispatchEvent(event)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.getQueriedSegments_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$getQueriedSegments_$() {
  return goog.array.map(this.segments_, function(segment) {
    return segment.inputText
  })
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.getSelectedSegments_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$getSelectedSegments_$() {
  return goog.array.map(this.segments_, function(segment) {
    return segment.suggestions.length <= segment.selected ? segment.inputText : segment.suggestions[segment.selected].getText()
  }, this)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.updateIndicator_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$updateIndicator_$() {
  var selectedSegment = this.segments_[this.selectedSegment_], focusedIndex = selectedSegment.selected + 1, totalSuggestions = selectedSegment.suggestions.length, indicatorText = focusedIndex + "/" + totalSuggestions;
  this.moreSuggestionsAvailableForCurrentSegment_() && (indicatorText += "+");
  goog.dom.setTextContent(this.suggestionIndicatorElement_, indicatorText)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.clearIndicator_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$clearIndicator_$() {
  goog.dom.removeChildren(this.suggestionIndicatorElement_)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.moreSuggestionsAvailableForCurrentSegment_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$moreSuggestionsAvailableForCurrentSegment_$() {
  var maxSuggestions = goog.array.reduce(this.segments_, function(max, segment) {
    return Math.max(max, segment.suggestions.length)
  }, 0), suggestions = this.segments_[this.selectedSegment_].suggestions;
  return suggestions.length >= maxSuggestions && this.canFetchMore_
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.STATE = {COMPOSITION:"composition", CONVERSION:"conversion"};
goog.ime.plugin.lang.MultiSegmentPopupEditor.Segment_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$Segment_$(inputText, opt_suggestions, opt_selectedSuggestion) {
  this.inputText = inputText;
  this.suggestions = opt_suggestions || [];
  this.selected = goog.isNumber(opt_selectedSuggestion) && 0 <= opt_selectedSuggestion && opt_selectedSuggestion < this.suggestions.length ? opt_selectedSuggestion : 0
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.clearEditorText_ = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$clearEditorText_$() {
  goog.dom.removeChildren(this.textEditorElement_);
  goog.dom.setTextContent(this.leftTextSpan_, "");
  goog.dom.setTextContent(this.rightTextSpan_, "");
  this.textEditorElement_.appendChild(this.leftTextSpan_);
  this.textEditorElement_.appendChild(this.cursorSpan_);
  this.textEditorElement_.appendChild(this.rightTextSpan_);
  this.cursorPos = 0
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.setTextInput = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$setTextInput$(textInput) {
  this.textInput_ = textInput
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.getPluginProxy = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$getPluginProxy$() {
  return this.pluginProxy_
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.forceHide = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$forceHide$() {
  this.commitEditorText(!1)
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.updateSuggestions = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$updateSuggestions$(suggestion, start, num) {
  this.setPageSize(num);
  this.updateChildrenSegments(suggestion.getSegments());
  this.reshowSuggestions()
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.getTransliteratableText = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$getTransliteratableText$(text) {
  return text
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.updateEditorText = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$updateEditorText$() {
  return!0
};
goog.ime.plugin.lang.MultiSegmentPopupEditor.prototype.isPreCommit = function $goog$ime$plugin$lang$MultiSegmentPopupEditor$$isPreCommit$() {
  return!1
};
goog.ime.plugin.lang.PrefixSuggestionItem = function $goog$ime$plugin$lang$PrefixSuggestionItem$(text, length, opt_annotation) {
  goog.Disposable.call(this);
  this.text_ = text;
  this.annotation_ = opt_annotation;
  this.length_ = length
};
goog.inherits(goog.ime.plugin.lang.PrefixSuggestionItem, goog.Disposable);
goog.ime.plugin.lang.PrefixSuggestionItem.Type = {VIETNAMESE_LOCAL:"vp"};
goog.ime.plugin.lang.PrefixSuggestionItem.prototype.setType = function $goog$ime$plugin$lang$PrefixSuggestionItem$$setType$(type) {
  this.type_ = type
};
goog.ime.plugin.lang.PrefixSuggestionItem.prototype.getType = function $goog$ime$plugin$lang$PrefixSuggestionItem$$getType$() {
  return this.type_
};
goog.ime.plugin.lang.PrefixSuggestionItem.prototype.getText = function $goog$ime$plugin$lang$PrefixSuggestionItem$$getText$() {
  return this.text_
};
goog.ime.plugin.lang.PrefixSuggestionItem.prototype.getLength = function $goog$ime$plugin$lang$PrefixSuggestionItem$$getLength$() {
  return this.length_
};
goog.ime.plugin.lang.PrefixSuggestionItem.prototype.getDisplayContent = function $goog$ime$plugin$lang$PrefixSuggestionItem$$getDisplayContent$(index) {
  return index + 1 + "." + this.text_
};
goog.ime.plugin.lang.PrefixSuggestionItem.prototype.getAnnotation = function $goog$ime$plugin$lang$PrefixSuggestionItem$$getAnnotation$() {
  return this.annotation_ ? "(" + this.annotation_ + ")" : null
};
goog.ime.plugin.lang.PrefixSuggestionItem.builder = function $goog$ime$plugin$lang$PrefixSuggestionItem$builder$(sugText, origText, extraResponse, sugIndex) {
  var tokenLengths = extraResponse[0], prefixLength = tokenLengths && tokenLengths[sugIndex] ? goog.isNumber(tokenLengths[sugIndex]) ? tokenLengths[sugIndex] : goog.array.reduce(tokenLengths[sugIndex], function(a, b) {
    return a + b
  }, 0) : origText.length, annotations = extraResponse[1] ? extraResponse[1].annotation : null;
  return annotations ? new goog.ime.plugin.lang.PrefixSuggestionItem(sugText, prefixLength, annotations[sugIndex]) : new goog.ime.plugin.lang.PrefixSuggestionItem(sugText, prefixLength)
};
goog.ime.plugin.lang.PopupEditorPlugin = function $goog$ime$plugin$lang$PopupEditorPlugin$(dataSource, popupEditorRenderer) {
  goog.ime.plugin.TransformationPlugin.call(this);
  this.dataSource_ = dataSource;
  this.popupEditorRenderer_ = popupEditorRenderer;
  this.staticTransliterator_ = goog.ime.plugin.lang.StaticTransliterator.getDefault();
  this.textInputStatus_ = {keyCode:-1, lastKey:-1};
  this.commitQueue_ = new goog.ime.plugin.lang.CommitQueue;
  this.popupEditorInitialized_ = !1;
  this.timerNumber_ = NaN;
  this.currentSuggestionInput_ = this.queriedText_ = ""
};
goog.inherits(goog.ime.plugin.lang.PopupEditorPlugin, goog.ime.plugin.TransformationPlugin);
goog.ime.plugin.lang.PopupEditorPlugin.prototype.isSupportedInputTool = function $goog$ime$plugin$lang$PopupEditorPlugin$$isSupportedInputTool$(inputTool) {
  return!!inputTool && goog.array.contains(goog.ime.plugin.lang.InputMethodFeatureConfig.getInputMethodsWithPopupEditor(), inputTool.code)
};
goog.ime.plugin.lang.PopupEditorPlugin.MSG_ON_EXCEED_INPUT_ = "Input text too long.";
goog.ime.plugin.lang.PopupEditorPlugin.prototype.logger = goog.debug.Logger.getLogger("goog.ime.plugin.lang.PopupEditorPlugin");
goog.ime.plugin.lang.PopupEditorPlugin.prototype.findSuggestionInLocal_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$findSuggestionInLocal_$(request, inputtoolcode) {
  var inputtool = goog.ime.lang.InputTool.get(inputtoolcode), translitQuery = goog.ime.plugin.lang.TranslitQuery.getMinBounded(request, inputtool, 1), suggestion = this.dataSource_.lookupCache(translitQuery);
  return suggestion
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.isSupportedCommand = function $goog$ime$plugin$lang$PopupEditorPlugin$$isSupportedCommand$(cmd) {
  return!!cmd && goog.array.contains([goog.ime.plugin.CommandType.CHANGE_STATE, goog.ime.plugin.CommandType.CHANGE_DIRECTION, goog.ime.plugin.CommandType.TOGGLE_SBC, goog.ime.plugin.CommandType.TOGGLE_LANGUAGE], cmd)
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.getEventTypes = function $goog$ime$plugin$lang$PopupEditorPlugin$$getEventTypes$() {
  return[goog.events.EventType.KEYDOWN, goog.events.EventType.KEYPRESS, goog.events.EventType.KEYUP, goog.events.EventType.MOUSEDOWN, goog.events.KeyHandler.EventType.KEY]
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.initPopupEditor_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$initPopupEditor_$(inputToolCodes) {
  goog.array.forEach(inputToolCodes, function(inputToolCode) {
    var popupEditor = this.popupEditorRenderer_.getEditor(goog.ime.lang.InputTool.get(inputToolCode));
    popupEditor.addEventListener(goog.ui.Component.EventType.ACTION, this.updateEditorText_, void 0, this);
    popupEditor.addEventListener(goog.ime.ui.PopupEditor.EventType.SUCCESS, this.applyTransliteration_, void 0, this);
    popupEditor.addEventListener(goog.ime.ui.PopupEditor.EventType.DISCARD, this.applyTransliteration_, void 0, this);
    popupEditor.addEventListener(goog.ime.ui.PopupEditor.EventType.FETCH_SUGGESTIONS, this.fetchSuggestions_, void 0, this);
    popupEditor.addEventListener(goog.ime.plugin.EventType.PRECOMMIT_EVENT, this.applyPreCommit_, void 0, this);
    popupEditor.addEventListener(goog.ime.plugin.EventType.TEXTCHANGED_EVENT, this.handleEditorTextChange_, void 0, this);
    popupEditor.addEventListener(goog.ime.plugin.EventType.PRECOMMITTIMER_EVENT, this.handlePreCommitTimer_, void 0, this)
  }, this)
};
goog.ime.plugin.lang.PopupEditorPlugin.PRECOMMIT_TIMER_INTERVAL = 1E3;
goog.ime.plugin.lang.PopupEditorPlugin.prototype.handlePreCommitTimeout_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$handlePreCommitTimeout_$() {
  this.getEditor_().isPreCommit() && (this.processCommitQueue_(), this.timerNumber_ = this.commitQueue_.isEmpty() ? NaN : goog.Timer.callOnce(goog.bind(this.handlePreCommitTimeout_, this), goog.ime.plugin.lang.PopupEditorPlugin.PRECOMMIT_TIMER_INTERVAL))
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.handlePreCommitTimer_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$handlePreCommitTimer_$(e) {
  this.getEditor_().isPreCommit() && (e.start ? isNaN(this.timerNumber_) && (this.timerNumber_ = goog.Timer.callOnce(goog.bind(this.handlePreCommitTimeout_, this), 0)) : isNaN(this.timerNumber_) || (goog.Timer.clear(this.timerNumber_), this.timerNumber_ = NaN))
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.register = function $goog$ime$plugin$lang$PopupEditorPlugin$$register$(host) {
  this.popupEditorInitialized_ || (this.initPopupEditor_(goog.ime.plugin.lang.InputMethodFeatureConfig.getInputMethodsWithPopupEditor()), this.popupEditorInitialized_ = !0);
  host.listenShortcut("shift", goog.ime.plugin.CommandType.TOGGLE_LANGUAGE);
  host.listenShortcut("shift+space", goog.ime.plugin.CommandType.TOGGLE_SBC);
  host.listenShortcut("ctrl+.", goog.ime.plugin.CommandType.PUNCTUATION);
  goog.ime.plugin.lang.PopupEditorPlugin.superClass_.register.call(this, host)
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.unregister = function $goog$ime$plugin$lang$PopupEditorPlugin$$unregister$(host) {
  goog.ime.plugin.lang.PopupEditorPlugin.superClass_.unregister.call(this, host);
  host.unlistenShortcut("shift", goog.ime.plugin.CommandType.TOGGLE_LANGUAGE);
  host.unlistenShortcut("shift+space", goog.ime.plugin.CommandType.TOGGLE_SBC);
  host.unlistenShortcut("ctrl+.", goog.ime.plugin.CommandType.PUNCTUATION)
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.applyPreCommit_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$applyPreCommit_$(e) {
  var queryText = e.query, commitText = e.commit;
  this.commitQueue_.push(queryText, commitText, this.currentInputTool.code);
  this.processCommitQueue_();
  return!0
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.processCommitQueue_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$processCommitQueue_$() {
  var commit_text = this.commitQueue_.process(goog.bind(this.findSuggestionInLocal_, this));
  commit_text && this.currentTextInput.commitText(commit_text);
  return!0
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.ignoreEvent_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$ignoreEvent_$(e) {
  if(goog.ime.plugin.EventUtil.isModifierEvent(e)) {
    if(e.type == goog.events.EventType.KEYDOWN) {
      var popupEditor = this.getEditor_();
      goog.isFunction(popupEditor.handleKeyDownForShortCutKeys) && popupEditor.handleKeyDownForShortCutKeys(e)
    }
    return!0
  }
  e.type == goog.events.EventType.KEYPRESS && goog.userAgent.GECKO && e.keyCode >= goog.events.KeyCodes.PAGE_UP && e.keyCode <= goog.events.KeyCodes.DELETE && (e.charCode = 0);
  return!1
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.applyTransliteration_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$applyTransliteration_$(e) {
  var popupEditor = this.getEditor_(), success = e.type == goog.ime.ui.PopupEditor.EventType.SUCCESS, transliteration = success ? popupEditor.getEditorText() : "";
  success && transliteration && this.commitTransliteration_(transliteration);
  if(e.followingEvent) {
    var keyEvent = new goog.events.KeyEvent(e.followingEvent.keyCode, e.followingEvent.charCode, !1, e.followingEvent), prop;
    for(prop in"ctrlKey,altKey,shiftKey,metaKey,platformModifierKey,state".split(",")) {
      keyEvent[prop] = e.followingEvent[prop]
    }
    goog.Timer.callOnce(goog.bind(this.handleEvent, this, this.currentTextInput, keyEvent), 0)
  }
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.commitTransliteration_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$commitTransliteration_$(transliteration) {
  var popupEditor = this.getEditor_(), queryText = popupEditor.getQueryText();
  this.commitQueue_.push(queryText, transliteration, this.currentInputTool.code);
  this.processCommitQueue_()
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.handleKeyEventInternal_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$handleKeyEventInternal_$(e) {
  var popupEditor = this.getEditor_(), proxy = popupEditor.getPluginProxy(), textInput = this.currentTextInput, keyEvent = null, ret = !1;
  e.type == goog.events.EventType.KEYDOWN && e.keyCode == goog.events.KeyCodes.ENTER ? keyEvent = new goog.events.KeyEvent(goog.events.KeyCodes.ENTER, 0, !1, e) : !proxy.isActive() && popupEditor.onStage() ? popupEditor.commitEditorText(!1) : keyEvent = e.type == goog.events.KeyHandler.EventType.KEY ? e : goog.ime.plugin.EventUtil.generateKeyEvent(e, this.textInputStatus_);
  if(keyEvent) {
    var ch = String.fromCharCode(keyEvent.charCode), mappingChar;
    if(popupEditor.onStage()) {
      this.logger.info("popup editor handle keyevent:" + ch), ret = popupEditor.handleKeyEventInternal(keyEvent)
    }else {
      if(mappingChar = proxy.getMappingChar(this.currentInputTool, e)) {
        this.commitQueue_.push(ch, mappingChar), ret = this.processCommitQueue_()
      }else {
        if(proxy.isActive() && proxy.isValidCharKey(popupEditor, keyEvent)) {
          this.queriedText_ = "";
          var editableElem = textInput.getEditableElement();
          if(textInput.controlType == goog.ime.dom.InputType.TEXTEDIT || textInput.controlType == goog.ime.dom.InputType.CUSTOMIZED) {
            this.popupEditorRenderer_.showPopupEditor(popupEditor, textInput.getCaretPosition(), keyEvent)
          }else {
            var range = goog.dom.Range.createFromWindow(goog.dom.getDomHelper(editableElem).getWindow());
            this.popupEditorRenderer_.showPopupEditorByRange(popupEditor, range, editableElem, keyEvent)
          }
          if(popupEditor.isPreCommit() && !isNaN(this.timerNumber_)) {
            var timerEvent = new goog.ime.plugin.PreCommitTimerEvent(!1);
            this.handlePreCommitTimer_(timerEvent)
          }
          ret = !0
        }
      }
    }
    keyEvent.dispose();
    this.handleEditorTextChange_()
  }
  return ret
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.handleEventInternal = function $goog$ime$plugin$lang$PopupEditorPlugin$$handleEventInternal$(textInput, e) {
  var m = "handleEvent:" + e.type;
  this.logger.info(m);
  if(this.ignoreEvent_(e)) {
    return this.logger.info(m + "Event ignored"), !1
  }
  var popupEditor = this.getEditor_();
  popupEditor.setTextInput(textInput);
  if(e.type == goog.events.EventType.MOUSEDOWN) {
    return goog.userAgent.IE && textInput.setFocus(), popupEditor.commitEditorText(!1), !1
  }
  var result = !1;
  if(e.type == goog.events.EventType.KEYDOWN || e.type == goog.events.EventType.KEYPRESS || e.type == goog.events.EventType.KEYUP || e.type == goog.events.KeyHandler.EventType.KEY) {
    result = this.handleKeyEventInternal_(e)
  }
  return result
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.updateSuggestions_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$updateSuggestions_$(popupEditor, query, sync, success, suggestion) {
  var m = "updateSuggestions_:";
  if(popupEditor.onStage()) {
    var queriedText = query.getText(), queryText = popupEditor.getQueryText();
    popupEditor.getTransliteratableText(queryText) || (queryText = popupEditor.getEditorText());
    if(queriedText != queryText && queriedText != queryText + ",") {
      this.logger.info(m + "Out of turn response. Discard, do nothing.")
    }else {
      if(!success || !suggestion) {
        this.logger.info(m + "Bad response:succ:" + success + ":sug:" + suggestion), popupEditor.clearSuggestions()
      }else {
        var start = query.getRequiredSugCount();
        this.currentSuggestionInput_ = queriedText;
        var config = goog.ime.lang.InputToolConfig.get(this.currentInputTool);
        this.popupEditorRenderer_.renderSuggestion(popupEditor, suggestion, config.showSuggestionCount, start - 1, query.queriedSugCount)
      }
    }
  }else {
    popupEditor.isPreCommit() && this.processCommitQueue_(), this.logger.info(m + "Popup editor is hidden. Do nothing.")
  }
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.updateEditorText_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$updateEditorText_$(e) {
  var popupEditor = this.getEditor_(), m = "updateEditorText_:", sugMenuItem = e.target, sugItem = sugMenuItem.getValue(), sugText = sugItem.getText(), queryText = popupEditor.getQueryText(), suggestionInput = this.currentSuggestionInput_;
  if(queryText == suggestionInput) {
    if(popupEditor.updateEditorText(sugItem)) {
      return popupEditor.commitEditorText(!0), !0
    }
    this.currentInputTool.code == goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_VIETNAMESE && sugItem.getType() == goog.ime.plugin.lang.PrefixSuggestionItem.Type.VIETNAMESE_LOCAL && (this.commitTransliteration_(sugText), popupEditor.modifyEditorText(sugText, ""), popupEditor.enterLocalMode())
  }else {
    this.logger.info(m + "suggestion text:" + sugText), this.logger.info(m + "input:" + suggestionInput + ":current:" + queryText)
  }
  this.handleEditorTextChange_();
  return!0
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.fetchSuggestions_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$fetchSuggestions_$(e) {
  this.logger.info("fetchSuggestions_:minSug::" + e.minSuggestions);
  return e.segments ? this.fetchMultiSegmentSuggestionsInternal_(e.target, e.segments, e.minSuggestions, e.requestSegmentation) : this.fetchSuggestionsInternal_(e.target, e.text, e.minSuggestions + 1)
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.fetchSuggestionsInternal_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$fetchSuggestionsInternal_$(popupEditor, text, minFetchSugCount) {
  if(!popupEditor.getTransliteratableText(text)) {
    return this.logger.info("fetchSuggestionsInternal_:text::" + text), !1
  }
  this.queriedText_ = text;
  var translitQuery = goog.ime.plugin.lang.TranslitQuery.getMinBounded(text, this.currentInputTool, minFetchSugCount), lookupStatus;
  if(this.currentInputTool.code == goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_VIETNAMESE) {
    if(popupEditor.isLocalMode()) {
      return popupEditor.lookup(goog.bind(this.updateSuggestions_, this, popupEditor, translitQuery))
    }
    var adjacentText = this.currentTextInput.getTextBeforeCaret(50);
    adjacentText && translitQuery.setHistoryText(popupEditor.getHistoryWords(adjacentText));
    translitQuery.setUseCache(!1)
  }
  lookupStatus = this.dataSource_.lookup(translitQuery, goog.bind(this.updateSuggestions_, this, popupEditor));
  return goog.isBoolean(lookupStatus)
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.fetchMultiSegmentSuggestionsInternal_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$fetchMultiSegmentSuggestionsInternal_$(popupEditor, segments, minFetchSugCount, requestToSegment) {
  var m = "fetchSuggestionsInternal_:";
  if(!segments || 0 == segments.length || !segments[0]) {
    return this.logger.info(m + "no input segments."), !1
  }
  var langCodePair = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.HIRAGANA, goog.ime.lang.LanguageCode.JAPANESE), query = goog.ime.plugin.lang.TranslitQuery.createMultiSegmentQuery(segments, langCodePair, minFetchSugCount, requestToSegment);
  this.queriedText_ = query.getText();
  var config = goog.ime.lang.InputToolConfig.get(this.currentInputTool);
  if(segments.join("").length > config.maxInputLength) {
    return popupEditor.showErrorMessage(goog.ime.plugin.lang.PopupEditorPlugin.MSG_ON_EXCEED_INPUT_), !1
  }
  var lookupStatus = this.dataSource_.lookup(query, goog.bind(this.updateSuggestions_, this, popupEditor));
  return goog.isBoolean(lookupStatus)
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.handleEditorTextChange_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$handleEditorTextChange_$() {
  var popupEditor = this.getEditor_(), m = "handleEditorTextChange_:";
  if(popupEditor.onStage() && !(popupEditor instanceof goog.ime.plugin.lang.MultiSegmentPopupEditor)) {
    var editorText = popupEditor.getEditorText();
    if(editorText) {
      var config = goog.ime.lang.InputToolConfig.get(this.currentInputTool);
      if(editorText.length > config.maxInputLength) {
        var errorStyle = {background:"#FFFFAA"};
        popupEditor.showErrorMessage(goog.ime.plugin.lang.PopupEditorPlugin.MSG_ON_EXCEED_INPUT_, errorStyle);
        this.queriedText_ = editorText
      }else {
        var queryText = popupEditor.getQueryText(), queriedText = this.queriedText_ || "", doSuggestion = !1;
        switch(this.currentInputTool.code) {
          case goog.ime.lang.InputToolCode.INPUTMETHOD_ZHUYIN_CHINESE_TRADITIONAL:
            doSuggestion = popupEditor.isFinished();
            break;
          default:
            doSuggestion = queryText != queriedText
        }
        doSuggestion && (this.logger.info(m + "Text:old<" + queriedText + ">new<" + queryText + ">"), popupEditor.disableSuggestions(), this.fetchSuggestionsInternal_(popupEditor, queryText, 1) || popupEditor.clearSuggestions())
      }
    }else {
      this.logger.info(m + "no text - commit empty editor"), popupEditor.commitEditorText(!1)
    }
  }
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.disposeInternal = function $goog$ime$plugin$lang$PopupEditorPlugin$$disposeInternal$() {
  var popupEditor = this.getEditor_();
  popupEditor.removeEventListener(goog.ui.Component.EventType.ACTION, goog.bind(this.updateEditorText_, this, popupEditor));
  var textCommitHandler = goog.bind(this.applyTransliteration_, this, popupEditor);
  popupEditor.removeEventListener(goog.ime.ui.PopupEditor.EventType.SUCCESS, textCommitHandler);
  popupEditor.removeEventListener(goog.ime.ui.PopupEditor.EventType.DISCARD, textCommitHandler);
  this.popupEditorRenderer_.dispose();
  goog.ime.plugin.lang.PopupEditorPlugin.superClass_.disposeInternal.call(this)
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.getEditor_ = function $goog$ime$plugin$lang$PopupEditorPlugin$$getEditor_$() {
  return this.popupEditorRenderer_.getEditor(this.currentInputTool)
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.execCommandInternal = function $goog$ime$plugin$lang$PopupEditorPlugin$$execCommandInternal$(cmd, var_args) {
  var clazz = goog.ime.plugin.lang.PopupEditorPlugin.superClass_;
  clazz.execCommandInternal.apply(this, arguments);
  if(this.isSupportedInputTool(this.currentInputTool)) {
    var editor = this.getEditor_();
    switch(cmd) {
      case goog.ime.plugin.CommandType.CHANGE_STATE:
        editor.forceHide();
        this.commitQueue_.clear();
        editor.isPreCommit() && !isNaN(this.timerNumber_) && (goog.Timer.clear(this.timerNumber_), this.timerNumber_ = NaN);
        break;
      default:
        if(this.currentTextInput && this.currentInputTool) {
          var proxy = editor.getPluginProxy();
          proxy.switchInputMode && proxy.switchInputMode(cmd, this.currentTextInput, this.currentInputTool)
        }
    }
  }
};
goog.ime.plugin.lang.PopupEditorPlugin.prototype.handleShortcut = function $goog$ime$plugin$lang$PopupEditorPlugin$$handleShortcut$(textInput, e) {
  goog.ime.plugin.lang.PopupEditorPlugin.superClass_.handleShortcut.apply(this, arguments);
  if(this.isSupportedInputTool(this.currentInputTool) && this.currentInputTool && this.currentTextInput) {
    var proxy = this.getEditor_().getPluginProxy();
    proxy.switchInputMode && proxy.switchInputMode(e.identifier, this.currentTextInput, this.currentInputTool)
  }
  return!1
};
goog.events.KeyNames = {8:"backspace", 9:"tab", 13:"enter", 16:"shift", 17:"ctrl", 18:"alt", 19:"pause", 20:"caps-lock", 27:"esc", 32:"space", 33:"pg-up", 34:"pg-down", 35:"end", 36:"home", 37:"left", 38:"up", 39:"right", 40:"down", 45:"insert", 46:"delete", 48:"0", 49:"1", 50:"2", 51:"3", 52:"4", 53:"5", 54:"6", 55:"7", 56:"8", 57:"9", 59:"semicolon", 61:"equals", 65:"a", 66:"b", 67:"c", 68:"d", 69:"e", 70:"f", 71:"g", 72:"h", 73:"i", 74:"j", 75:"k", 76:"l", 77:"m", 78:"n", 79:"o", 80:"p", 81:"q", 
82:"r", 83:"s", 84:"t", 85:"u", 86:"v", 87:"w", 88:"x", 89:"y", 90:"z", 93:"context", 96:"num-0", 97:"num-1", 98:"num-2", 99:"num-3", 100:"num-4", 101:"num-5", 102:"num-6", 103:"num-7", 104:"num-8", 105:"num-9", 106:"num-multiply", 107:"num-plus", 109:"num-minus", 110:"num-period", 111:"num-division", 112:"f1", 113:"f2", 114:"f3", 115:"f4", 116:"f5", 117:"f6", 118:"f7", 119:"f8", 120:"f9", 121:"f10", 122:"f11", 123:"f12", 186:"semicolon", 187:"equals", 188:",", 190:".", 191:"/", 192:"~", 219:"open-square-bracket", 
220:"\\", 221:"close-square-bracket", 222:"single-quote", 224:"win"};
goog.ui.KeyboardShortcutHandler = function $goog$ui$KeyboardShortcutHandler$(keyTarget) {
  goog.events.EventTarget.call(this);
  this.shortcuts_ = {};
  this.lastKeys_ = {strokes:[], time:0};
  this.globalKeys_ = goog.object.createSet(goog.ui.KeyboardShortcutHandler.DEFAULT_GLOBAL_KEYS_);
  this.alwaysPreventDefault_ = !0;
  this.allShortcutsAreGlobal_ = this.alwaysStopPropagation_ = !1;
  this.modifierShortcutsAreGlobal_ = !0;
  this.initializeKeyListener(keyTarget)
};
goog.inherits(goog.ui.KeyboardShortcutHandler, goog.events.EventTarget);
goog.ui.KeyboardShortcutHandler.MAX_KEY_SEQUENCE_DELAY = 1500;
goog.ui.KeyboardShortcutHandler.Modifiers = {NONE:0, SHIFT:1, CTRL:2, ALT:4, META:8};
goog.ui.KeyboardShortcutHandler.DEFAULT_GLOBAL_KEYS_ = [goog.events.KeyCodes.ESC, goog.events.KeyCodes.F1, goog.events.KeyCodes.F2, goog.events.KeyCodes.F3, goog.events.KeyCodes.F4, goog.events.KeyCodes.F5, goog.events.KeyCodes.F6, goog.events.KeyCodes.F7, goog.events.KeyCodes.F8, goog.events.KeyCodes.F9, goog.events.KeyCodes.F10, goog.events.KeyCodes.F11, goog.events.KeyCodes.F12, goog.events.KeyCodes.PAUSE];
goog.ui.KeyboardShortcutHandler.EventType = {SHORTCUT_TRIGGERED:"shortcut", SHORTCUT_PREFIX:"shortcut_"};
goog.ui.KeyboardShortcutHandler.getKeyCode = function $goog$ui$KeyboardShortcutHandler$getKeyCode$(name) {
  if(!goog.ui.KeyboardShortcutHandler.nameToKeyCodeCache_) {
    var map = {}, key;
    for(key in goog.events.KeyNames) {
      map[goog.events.KeyNames[key]] = key
    }
    goog.ui.KeyboardShortcutHandler.nameToKeyCodeCache_ = map
  }
  return goog.ui.KeyboardShortcutHandler.nameToKeyCodeCache_[name]
};
goog.ui.KeyboardShortcutHandler.prototype.setAllShortcutsAreGlobal = function $goog$ui$KeyboardShortcutHandler$$setAllShortcutsAreGlobal$(allShortcutsGlobal) {
  this.allShortcutsAreGlobal_ = allShortcutsGlobal
};
goog.ui.KeyboardShortcutHandler.prototype.registerShortcut = function $goog$ui$KeyboardShortcutHandler$$registerShortcut$(identifier, var_args) {
  goog.ui.KeyboardShortcutHandler.setShortcut_(this.shortcuts_, this.interpretStrokes_(1, arguments), identifier)
};
goog.ui.KeyboardShortcutHandler.prototype.unregisterShortcut = function $goog$ui$KeyboardShortcutHandler$$unregisterShortcut$(var_args) {
  goog.ui.KeyboardShortcutHandler.setShortcut_(this.shortcuts_, this.interpretStrokes_(0, arguments), null)
};
goog.ui.KeyboardShortcutHandler.prototype.isShortcutRegistered = function $goog$ui$KeyboardShortcutHandler$$isShortcutRegistered$(var_args) {
  return this.checkShortcut_(this.interpretStrokes_(0, arguments))
};
goog.ui.KeyboardShortcutHandler.prototype.interpretStrokes_ = function $goog$ui$KeyboardShortcutHandler$$interpretStrokes_$(initialIndex, args) {
  var strokes;
  if(goog.isString(args[initialIndex])) {
    strokes = goog.ui.KeyboardShortcutHandler.parseStringShortcut(args[initialIndex])
  }else {
    var strokesArgs = args, i = initialIndex;
    goog.isArray(args[initialIndex]) && (strokesArgs = args[initialIndex], i = 0);
    for(strokes = [];i < strokesArgs.length;i += 2) {
      strokes.push({keyCode:strokesArgs[i], modifiers:strokesArgs[i + 1]})
    }
  }
  return strokes
};
goog.ui.KeyboardShortcutHandler.prototype.unregisterAll = function $goog$ui$KeyboardShortcutHandler$$unregisterAll$() {
  this.shortcuts_ = {}
};
goog.ui.KeyboardShortcutHandler.prototype.disposeInternal = function $goog$ui$KeyboardShortcutHandler$$disposeInternal$() {
  goog.ui.KeyboardShortcutHandler.superClass_.disposeInternal.call(this);
  this.unregisterAll();
  this.clearKeyListener()
};
goog.ui.KeyboardShortcutHandler.prototype.getEventType = function $goog$ui$KeyboardShortcutHandler$$getEventType$(identifier) {
  return goog.ui.KeyboardShortcutHandler.EventType.SHORTCUT_PREFIX + identifier
};
goog.ui.KeyboardShortcutHandler.parseStringShortcut = function $goog$ui$KeyboardShortcutHandler$parseStringShortcut$(s) {
  for(var s = s.replace(/[ +]*\+[ +]*/g, "+").replace(/[ ]+/g, " ").toLowerCase(), groups = s.split(" "), strokes = [], group, i = 0;group = groups[i];i++) {
    for(var keys = group.split("+"), keyCode, modifiers = goog.ui.KeyboardShortcutHandler.Modifiers.NONE, key, j = 0;key = keys[j];j++) {
      switch(key) {
        case "shift":
          modifiers |= goog.ui.KeyboardShortcutHandler.Modifiers.SHIFT;
          continue;
        case "ctrl":
          modifiers |= goog.ui.KeyboardShortcutHandler.Modifiers.CTRL;
          continue;
        case "alt":
          modifiers |= goog.ui.KeyboardShortcutHandler.Modifiers.ALT;
          continue;
        case "meta":
          modifiers |= goog.ui.KeyboardShortcutHandler.Modifiers.META;
          continue
      }
      keyCode = goog.ui.KeyboardShortcutHandler.getKeyCode(key);
      break
    }
    strokes.push({keyCode:keyCode, modifiers:modifiers})
  }
  return strokes
};
goog.ui.KeyboardShortcutHandler.prototype.initializeKeyListener = function $goog$ui$KeyboardShortcutHandler$$initializeKeyListener$(keyTarget) {
  this.keyTarget_ = keyTarget;
  goog.events.listen(this.keyTarget_, goog.events.EventType.KEYDOWN, this.handleKeyDown_, !1, this);
  goog.userAgent.MAC && goog.userAgent.GECKO && goog.userAgent.isVersion("1.8") && goog.events.listen(this.keyTarget_, goog.events.EventType.KEYUP, this.handleMacGeckoKeyUp_, !1, this);
  goog.userAgent.WINDOWS && !goog.userAgent.GECKO && (goog.events.listen(this.keyTarget_, goog.events.EventType.KEYPRESS, this.handleWindowsKeyPress_, !1, this), goog.events.listen(this.keyTarget_, goog.events.EventType.KEYUP, this.handleWindowsKeyUp_, !1, this))
};
goog.ui.KeyboardShortcutHandler.prototype.handleMacGeckoKeyUp_ = function $goog$ui$KeyboardShortcutHandler$$handleMacGeckoKeyUp_$(e) {
  if(e.keyCode == goog.events.KeyCodes.MAC_FF_META) {
    this.metaKeyRecentlyReleased_ = !0, goog.Timer.callOnce(function() {
      this.metaKeyRecentlyReleased_ = !1
    }, 400, this)
  }else {
    var metaKey = e.metaKey || this.metaKeyRecentlyReleased_;
    if((e.keyCode == goog.events.KeyCodes.C || e.keyCode == goog.events.KeyCodes.X || e.keyCode == goog.events.KeyCodes.V) && metaKey) {
      e.metaKey = metaKey, this.handleKeyDown_(e)
    }
  }
};
goog.ui.KeyboardShortcutHandler.prototype.isPossiblePrintableKey_ = function $goog$ui$KeyboardShortcutHandler$$isPossiblePrintableKey_$(e) {
  return goog.userAgent.WINDOWS && !goog.userAgent.GECKO && e.ctrlKey && e.altKey && !e.shiftKey
};
goog.ui.KeyboardShortcutHandler.prototype.handleWindowsKeyPress_ = function $goog$ui$KeyboardShortcutHandler$$handleWindowsKeyPress_$(e) {
  32 < e.keyCode && this.isPossiblePrintableKey_(e) && (this.isPrintableKey_ = !0)
};
goog.ui.KeyboardShortcutHandler.prototype.handleWindowsKeyUp_ = function $goog$ui$KeyboardShortcutHandler$$handleWindowsKeyUp_$(e) {
  !this.isPrintableKey_ && this.isPossiblePrintableKey_(e) && this.handleKeyDown_(e)
};
goog.ui.KeyboardShortcutHandler.prototype.clearKeyListener = function $goog$ui$KeyboardShortcutHandler$$clearKeyListener$() {
  goog.events.unlisten(this.keyTarget_, goog.events.EventType.KEYDOWN, this.handleKeyDown_, !1, this);
  goog.userAgent.MAC && goog.userAgent.GECKO && goog.userAgent.isVersion("1.8") && goog.events.unlisten(this.keyTarget_, goog.events.EventType.KEYUP, this.handleMacGeckoKeyUp_, !1, this);
  goog.userAgent.WINDOWS && !goog.userAgent.GECKO && (goog.events.unlisten(this.keyTarget_, goog.events.EventType.KEYPRESS, this.handleWindowsKeyPress_, !1, this), goog.events.unlisten(this.keyTarget_, goog.events.EventType.KEYUP, this.handleWindowsKeyUp_, !1, this));
  this.keyTarget_ = null
};
goog.ui.KeyboardShortcutHandler.setShortcut_ = function $goog$ui$KeyboardShortcutHandler$setShortcut_$(parent, strokes, identifier) {
  var stroke = strokes.shift(), key = goog.ui.KeyboardShortcutHandler.makeKey_(stroke.keyCode, stroke.modifiers), node = parent[key];
  if(node && identifier && (0 == strokes.length || goog.isString(node))) {
    throw Error("Keyboard shortcut conflicts with existing shortcut");
  }
  strokes.length ? (node || (node = parent[key] = {}), goog.ui.KeyboardShortcutHandler.setShortcut_(node, strokes, identifier)) : parent[key] = identifier
};
goog.ui.KeyboardShortcutHandler.prototype.getShortcut_ = function $goog$ui$KeyboardShortcutHandler$$getShortcut_$(strokes, opt_index, opt_list) {
  var list = opt_list || this.shortcuts_, index = opt_index || 0, stroke = strokes[index], node = list[stroke];
  return node && !goog.isString(node) && 1 < strokes.length - index ? this.getShortcut_(strokes, index + 1, node) : node
};
goog.ui.KeyboardShortcutHandler.prototype.checkShortcut_ = function $goog$ui$KeyboardShortcutHandler$$checkShortcut_$(strokes) {
  for(var node = this.shortcuts_;0 < strokes.length && node;) {
    var stroke = strokes.shift(), key = goog.ui.KeyboardShortcutHandler.makeKey_(stroke.keyCode, stroke.modifiers), node = node[key];
    if(goog.isString(node)) {
      return!0
    }
  }
  return!1
};
goog.ui.KeyboardShortcutHandler.makeKey_ = function $goog$ui$KeyboardShortcutHandler$makeKey_$(keyCode, modifiers) {
  return keyCode & 255 | modifiers << 8
};
goog.ui.KeyboardShortcutHandler.prototype.handleKeyDown_ = function $goog$ui$KeyboardShortcutHandler$$handleKeyDown_$(event) {
  if(this.isValidShortcut_(event)) {
    if("keydown" == event.type && this.isPossiblePrintableKey_(event)) {
      this.isPrintableKey_ = !1
    }else {
      var keyCode = goog.userAgent.GECKO ? goog.events.KeyCodes.normalizeGeckoKeyCode(event.keyCode) : event.keyCode, modifiers = (event.shiftKey ? goog.ui.KeyboardShortcutHandler.Modifiers.SHIFT : 0) | (event.ctrlKey ? goog.ui.KeyboardShortcutHandler.Modifiers.CTRL : 0) | (event.altKey ? goog.ui.KeyboardShortcutHandler.Modifiers.ALT : 0) | (event.metaKey ? goog.ui.KeyboardShortcutHandler.Modifiers.META : 0), stroke = goog.ui.KeyboardShortcutHandler.makeKey_(keyCode, modifiers), node, shortcut, now = 
      goog.now();
      this.lastKeys_.strokes.length && now - this.lastKeys_.time <= goog.ui.KeyboardShortcutHandler.MAX_KEY_SEQUENCE_DELAY ? node = this.getShortcut_(this.lastKeys_.strokes) : this.lastKeys_.strokes.length = 0;
      node = node ? node[stroke] : this.shortcuts_[stroke];
      node || (node = this.shortcuts_[stroke], this.lastKeys_.strokes = []);
      node && goog.isString(node) ? shortcut = node : node ? (this.lastKeys_.strokes.push(stroke), this.lastKeys_.time = now, goog.userAgent.GECKO && event.preventDefault()) : this.lastKeys_.strokes.length = 0;
      if(shortcut) {
        this.alwaysPreventDefault_ && event.preventDefault();
        this.alwaysStopPropagation_ && event.stopPropagation();
        var types = goog.ui.KeyboardShortcutHandler.EventType, target = event.target, triggerEvent = new goog.ui.KeyboardShortcutEvent(types.SHORTCUT_TRIGGERED, shortcut, target), retVal = this.dispatchEvent(triggerEvent), prefixEvent = new goog.ui.KeyboardShortcutEvent(types.SHORTCUT_PREFIX + shortcut, shortcut, target);
        (retVal &= this.dispatchEvent(prefixEvent)) || event.preventDefault();
        this.lastKeys_.strokes.length = 0
      }
    }
  }
};
goog.ui.KeyboardShortcutHandler.prototype.isValidShortcut_ = function $goog$ui$KeyboardShortcutHandler$$isValidShortcut_$(event) {
  var keyCode = event.keyCode;
  if(keyCode == goog.events.KeyCodes.SHIFT || keyCode == goog.events.KeyCodes.CTRL || keyCode == goog.events.KeyCodes.ALT) {
    return!1
  }
  var el = event.target, isFormElement = "TEXTAREA" == el.tagName || "INPUT" == el.tagName || "BUTTON" == el.tagName || "SELECT" == el.tagName, isContentEditable = !isFormElement && (el.isContentEditable || el.ownerDocument && "on" == el.ownerDocument.designMode);
  return!isFormElement && !isContentEditable || this.globalKeys_[keyCode] || this.allShortcutsAreGlobal_ ? !0 : isContentEditable ? !1 : this.modifierShortcutsAreGlobal_ && (event.altKey || event.ctrlKey || event.metaKey) ? !0 : "INPUT" == el.tagName && ("text" == el.type || "password" == el.type) ? keyCode == goog.events.KeyCodes.ENTER : "INPUT" == el.tagName || "BUTTON" == el.tagName ? keyCode != goog.events.KeyCodes.SPACE : !1
};
goog.ui.KeyboardShortcutEvent = function $goog$ui$KeyboardShortcutEvent$(type, identifier, target) {
  goog.events.Event.call(this, type, target);
  this.identifier = identifier
};
goog.inherits(goog.ui.KeyboardShortcutEvent, goog.events.Event);
goog.ime.common.KeyboardShortcutHandler = function $goog$ime$common$KeyboardShortcutHandler$(keyTarget) {
  goog.ui.KeyboardShortcutHandler.call(this, keyTarget);
  this.keys_ = {};
  this.lastKeydownValue_ = 0
};
goog.inherits(goog.ime.common.KeyboardShortcutHandler, goog.ui.KeyboardShortcutHandler);
goog.ime.common.KeyboardShortcutHandler.prototype.registerShortcut = function $goog$ime$common$KeyboardShortcutHandler$$registerShortcut$(identifier, var_args) {
  if(goog.isString(arguments[1])) {
    var strokes = goog.ui.KeyboardShortcutHandler.parseStringShortcut(arguments[1]);
    if(1 == strokes.length) {
      var stroke = strokes[0], keyCode = stroke.keyCode;
      if(!keyCode || goog.ui.KeyboardShortcutHandler.Modifiers.SHIFT & stroke.modifiers) {
        keyCode || (stroke.keyCode = goog.ui.KeyboardShortcutHandler.Modifiers.SHIFT & stroke.modifiers ? goog.events.KeyCodes.SHIFT : goog.ui.KeyboardShortcutHandler.Modifiers.ALT & stroke.modifiers ? goog.events.KeyCodes.ALT : goog.ui.KeyboardShortcutHandler.Modifiers.META & stroke.modifiers ? goog.events.KeyCodes.META : goog.events.KeyCodes.CTRL);
        this.keys_[stroke.keyCode & 255 | stroke.modifiers << 8] = identifier;
        return
      }
    }
  }
  goog.ime.common.KeyboardShortcutHandler.superClass_.registerShortcut.apply(this, arguments)
};
goog.ime.common.KeyboardShortcutHandler.prototype.initializeKeyListener = function $goog$ime$common$KeyboardShortcutHandler$$initializeKeyListener$(keyTarget) {
  goog.ime.common.KeyboardShortcutHandler.superClass_.initializeKeyListener.call(this, keyTarget);
  goog.events.listen(keyTarget, goog.events.EventType.KEYDOWN, this.handleSpecailKeyDown_, !1, this);
  goog.events.listen(keyTarget, goog.events.EventType.KEYUP, this.handleSpecailKeyUp_, !1, this)
};
goog.ime.common.KeyboardShortcutHandler.prototype.handleSpecailKeyDown_ = function $goog$ime$common$KeyboardShortcutHandler$$handleSpecailKeyDown_$(e) {
  var keyCode = goog.userAgent.GECKO ? goog.events.KeyCodes.normalizeGeckoKeyCode(e.keyCode) : e.keyCode, modifiers = this.getModifiers_(e);
  this.lastKeydownValue_ = keyCode & 255 | modifiers << 8;
  var shortcut = this.keys_[this.lastKeydownValue_];
  shortcut && (e.preventDefault(), e.stopPropagation())
};
goog.ime.common.KeyboardShortcutHandler.prototype.handleSpecailKeyUp_ = function $goog$ime$common$KeyboardShortcutHandler$$handleSpecailKeyUp_$(e) {
  var keyCode = goog.userAgent.GECKO ? goog.events.KeyCodes.normalizeGeckoKeyCode(e.keyCode) : e.keyCode, modifiers = this.getModifiers_(e), keyValue = keyCode & 255 | modifiers << 8;
  if(keyValue == this.lastKeydownValue_) {
    var shortcut = this.keys_[keyValue];
    if(shortcut) {
      var types = goog.ui.KeyboardShortcutHandler.EventType, target = e.target, triggerEvent = new goog.ui.KeyboardShortcutEvent(types.SHORTCUT_TRIGGERED, shortcut, target);
      this.dispatchEvent(triggerEvent);
      var prefixEvent = new goog.ui.KeyboardShortcutEvent(types.SHORTCUT_PREFIX + shortcut, shortcut, target);
      this.dispatchEvent(prefixEvent)
    }
  }
  this.lastKeydownValue_ = 0
};
goog.ime.common.KeyboardShortcutHandler.prototype.getModifiers_ = function $goog$ime$common$KeyboardShortcutHandler$$getModifiers_$(e) {
  return(e.shiftKey || e.keyCode == goog.events.KeyCodes.SHIFT ? goog.ui.KeyboardShortcutHandler.Modifiers.SHIFT : 0) | (e.ctrlKey || e.keyCode == goog.events.KeyCodes.CTRL ? goog.ui.KeyboardShortcutHandler.Modifiers.CTRL : 0) | (e.altKey || e.keyCode == goog.events.KeyCodes.ALT ? goog.ui.KeyboardShortcutHandler.Modifiers.ALT : 0) | (e.metaKey || e.keyCode == goog.events.KeyCodes.META ? goog.ui.KeyboardShortcutHandler.Modifiers.META : 0)
};
goog.ime.plugin.GlobalEventDelegate = function $goog$ime$plugin$GlobalEventDelegate$() {
  this.listeners_ = {};
  this.keyListeners_ = {};
  this.iframeDocuments_ = []
};
goog.ime.plugin.GlobalEventDelegate.prototype.initPageIframes_ = function $goog$ime$plugin$GlobalEventDelegate$$initPageIframes_$() {
  this.iframeDocuments_ = [];
  goog.array.forEach(goog.dom.getElementsByTagNameAndClass("iframe"), function(iframe) {
    var frameDoc;
    try {
      frameDoc = goog.dom.getFrameContentDocument(iframe)
    }catch(e) {
    }
    frameDoc && this.iframeDocuments_.push(frameDoc)
  }, this)
};
goog.ime.plugin.GlobalEventDelegate.prototype.listen_ = function $goog$ime$plugin$GlobalEventDelegate$$listen_$(eventType, listener) {
  goog.events.listen(document, eventType, listener, !0, this);
  goog.array.forEach(this.iframeDocuments_, function(doc) {
    try {
      goog.events.listen(doc, eventType, listener, !0, this)
    }catch(e) {
    }
  }, this)
};
goog.ime.plugin.GlobalEventDelegate.prototype.unlisten_ = function $goog$ime$plugin$GlobalEventDelegate$$unlisten_$(eventType, listener) {
  goog.events.unlisten(document, eventType, listener, !0, this);
  goog.array.forEach(this.iframeDocuments_, function(doc) {
    try {
      goog.events.unlisten(doc, eventType, listener, !0, this)
    }catch(e) {
    }
  }, this)
};
goog.ime.plugin.GlobalEventDelegate.prototype.delegateEvent = function $goog$ime$plugin$GlobalEventDelegate$$delegateEvent$(src, type, listener, opt_handler) {
  if(type) {
    if(goog.isArray(type)) {
      for(var i = 0;i < type.length;i++) {
        this.delegateEvent(src, type[i], listener, opt_handler)
      }
    }else {
      opt_handler && goog.isFunction(listener) && (listener = goog.bind(listener, opt_handler));
      var map = this.listeners_[type];
      map || (map = {}, this.listeners_[type] = map, this.listen_(type, this.eventHandler_));
      var listenerArray = map[goog.getUid(src)];
      listenerArray || (listenerArray = [], map[goog.getUid(src)] = listenerArray);
      goog.array.contains(listenerArray, listener) || listenerArray.push(listener)
    }
  }else {
    throw Error("Invalid event type");
  }
};
goog.ime.plugin.GlobalEventDelegate.prototype.removeDelegateEvent = function $goog$ime$plugin$GlobalEventDelegate$$removeDelegateEvent$(src, type, listener) {
  if(type) {
    if(goog.isArray(type)) {
      for(var i = 0;i < type.length;i++) {
        this.removeDelegateEvent(src, type[i], listener)
      }
    }else {
      var map = this.listeners_[type];
      if(map) {
        var listenerArray = map[goog.getUid(src)];
        listenerArray && goog.array.remove(listenerArray, listener);
        goog.array.isEmpty(listenerArray) && delete map[goog.getUid(src)];
        goog.object.isEmpty(map) && (delete this.listeners_[type], this.unlisten_(type, this.eventHandler_))
      }
    }
  }else {
    throw Error("Invalid event type");
  }
};
goog.ime.plugin.GlobalEventDelegate.prototype.delegateKey = function $goog$ime$plugin$GlobalEventDelegate$$delegateKey$(src, charCode, listener, opt_handler) {
  if(charCode) {
    if(goog.isArray(charCode)) {
      for(var i = 0;i < charCode.length;i++) {
        this.delegateKey(src, charCode[i], listener, opt_handler)
      }
    }else {
      opt_handler && goog.isFunction(listener) && (listener = goog.bind(listener, opt_handler));
      var keyMap = this.keyListeners_;
      goog.object.isEmpty(keyMap) && this.listen_(goog.events.EventType.KEYPRESS, this.keyHandler_);
      var map = keyMap[charCode];
      map || (map = {}, keyMap[charCode] = map);
      var listenerArray = map[goog.getUid(src)];
      listenerArray || (listenerArray = [], map[goog.getUid(src)] = listenerArray);
      goog.array.contains(listenerArray, listener) || listenerArray.push(listener)
    }
  }else {
    throw Error("Invalid char code");
  }
};
goog.ime.plugin.GlobalEventDelegate.prototype.removeDelegateKey = function $goog$ime$plugin$GlobalEventDelegate$$removeDelegateKey$(src, charCode, listener, opt_handler) {
  if(charCode) {
    if(goog.isArray(charCode)) {
      for(var i = 0;i < charCode.length;i++) {
        this.removeDelegateKey(src, charCode[i], listener, opt_handler)
      }
    }else {
      var keyMap = this.keyListeners_;
      if(keyMap) {
        var map = keyMap[charCode];
        if(map) {
          var listenerArray = map[goog.getUid(src)];
          listenerArray && goog.array.remove(listenerArray, listener);
          goog.array.isEmpty(listenerArray) && delete map[goog.getUid(src)]
        }
        goog.object.isEmpty(map) && delete keyMap[charCode];
        goog.object.isEmpty(keyMap) && this.unlisten_(goog.events.EventType.KEYPRESS, this.keyHandler_)
      }
    }
  }else {
    throw Error("Invalid char code");
  }
};
goog.ime.plugin.GlobalEventDelegate.prototype.eventHandler_ = function $goog$ime$plugin$GlobalEventDelegate$$eventHandler_$(e) {
  var map = this.listeners_[e.type];
  if(map && e.target) {
    var listenerArray = map[goog.getUid(e.target)];
    if(listenerArray) {
      return goog.array.some(listenerArray, function(listener) {
        if(goog.isFunction(listener)) {
          return listener.call(void 0, e)
        }
        if(listener && listener.handleEvent && goog.isFunction(listener.handleEvent)) {
          return listener.handleEvent.call(listener, e)
        }
      })
    }
  }
  return!1
};
goog.ime.plugin.GlobalEventDelegate.prototype.keyHandler_ = function $goog$ime$plugin$GlobalEventDelegate$$keyHandler_$(e) {
  var map = this.keyListeners_[e.charCode];
  if(map && e.target) {
    var listenerArray = map[goog.getUid(e.target)];
    if(listenerArray) {
      return goog.array.some(listenerArray, function(listener) {
        if(goog.isFunction(listener)) {
          return listener.call(void 0, e)
        }
        if(listener && listener.handleEvent && goog.isFunction(listener.handleEvent)) {
          return listener.handleEvent.call(listener, e)
        }
      })
    }
  }
  return!1
};
goog.ime.plugin.GlobalEventDelegate.getInstance = function $goog$ime$plugin$GlobalEventDelegate$getInstance$() {
  goog.ime.plugin.GlobalEventDelegate.instance_ || (goog.ime.plugin.GlobalEventDelegate.instance_ = new goog.ime.plugin.GlobalEventDelegate, goog.ime.plugin.GlobalEventDelegate.instance_.initPageIframes_());
  return goog.ime.plugin.GlobalEventDelegate.instance_
};
goog.ime.plugin.GlobalEventDelegate.delegateEvent = function $goog$ime$plugin$GlobalEventDelegate$delegateEvent$(src, type, listener, opt_handler) {
  goog.ime.plugin.GlobalEventDelegate.getInstance().delegateEvent(src, type, listener, opt_handler)
};
goog.ime.plugin.GlobalEventDelegate.removeDelegateEvent = function $goog$ime$plugin$GlobalEventDelegate$removeDelegateEvent$(src, type, listener) {
  goog.ime.plugin.GlobalEventDelegate.getInstance().removeDelegateEvent(src, type, listener)
};
goog.ime.plugin.GlobalEventDelegate.delegateKey = function $goog$ime$plugin$GlobalEventDelegate$delegateKey$(src, charCode, listener, opt_handler) {
  goog.ime.plugin.GlobalEventDelegate.getInstance().delegateKey(src, charCode, listener, opt_handler)
};
goog.ime.plugin.GlobalEventDelegate.removeDelegateKey = function $goog$ime$plugin$GlobalEventDelegate$removeDelegateKey$(src, charCode, listener, opt_handler) {
  goog.ime.plugin.GlobalEventDelegate.getInstance().removeDelegateKey(src, charCode, listener, opt_handler)
};
goog.ime.dom.TextInput = function $goog$ime$dom$TextInput$(element, type) {
  goog.events.EventTarget.call(this);
  this.usesIframe = !1;
  this.editableElement = this.containerElement = element.commitText ? document.body : element;
  this.inputable = element.commitText ? element : null;
  this.controlType = type;
  this.eventHandler = new goog.events.EventHandler(this);
  this.isDelegation = this.editableElement && this.editableElement.getAttribute && (!!this.editableElement.getAttribute("goog_input_bookmarklet") || !!this.editableElement.getAttribute("goog_input_chext"));
  this.idTokenMap_ = {};
  this.nodeIdCounter_ = 0
};
goog.inherits(goog.ime.dom.TextInput, goog.events.EventTarget);
goog.ime.dom.TextInput.prototype.getTextBeforeCaret = function $goog$ime$dom$TextInput$$getTextBeforeCaret$(opt_maxLength) {
  if(this.inputable) {
    return this.inputable.getTextBeforeCaret(opt_maxLength)
  }
  var token = this.getSelectionToken();
  if(token) {
    var caret = token.getStart();
    if(caret) {
      var maxLength = opt_maxLength ? opt_maxLength : 50;
      return caret.getBeforeFixText(maxLength)
    }
  }
  return""
};
goog.ime.dom.TextInput.prototype.commitText = function $goog$ime$dom$TextInput$$commitText$(text, opt_back) {
  if(this.inputable) {
    this.inputable.commitText(text, opt_back)
  }else {
    var token = this.getSelectionToken();
    token && (token.saveCurrentText(), token.replace(text), token.placeCaret(!0), token.dispose())
  }
};
goog.ime.dom.TextInput.prototype.getCaretPosition = function $goog$ime$dom$TextInput$$getCaretPosition$() {
  if(this.inputable) {
    return this.inputable.getCaretPosition()
  }
  var token = this.getSelectionToken();
  if(token) {
    var pos = token.getPosition();
    token.dispose();
    return pos
  }
  return null
};
goog.ime.dom.TextInput.prototype.setFocus = function $goog$ime$dom$TextInput$$setFocus$() {
  this.inputable && this.inputable.setFocus()
};
goog.ime.dom.TextInput.BUILD_SOURCE = "defaut";
goog.ime.dom.TextInput.NODEID_PREFIX = "_TRN_";
goog.ime.dom.TextInput.RESOURCEID_PREFIX_ = "r";
goog.ime.dom.TextInput.resourceIdCounter_ = 0;
goog.ime.dom.TextInput.prototype.logger = goog.debug.Logger.getLogger("goog.ime.dom.TextInput");
goog.ime.dom.TextInput.prototype.disposeInternal = function $goog$ime$dom$TextInput$$disposeInternal$() {
  goog.ime.dom.TextInput.superClass_.disposeInternal.call(this);
  this.eventHandler.dispose();
  this.eventHandler = null;
  this.keyboardShortcutHandler_ && (this.keyboardShortcutHandler_.dispose(), this.keyboardShortcutHandler_ = null);
  this.domHelper_ = this.editableElement = this.containerElement = this.idTokenMap_ = null
};
goog.ime.dom.TextInput.generateResourceId = function $goog$ime$dom$TextInput$generateResourceId$(resourceId) {
  var resId = (goog.ime.dom.TextInput.resourceIdCounter_++).toString(36);
  return(ITA_FLAGS_DEBUG ? resourceId : goog.ime.dom.TextInput.RESOURCEID_PREFIX_) + "#" + resId
};
goog.ime.dom.TextInput.prototype.generateNodeId = function $goog$ime$dom$TextInput$$generateNodeId$() {
  return goog.getUid(this) + goog.ime.dom.TextInput.NODEID_PREFIX + (this.nodeIdCounter_++).toString(36)
};
goog.ime.dom.TextInput.prototype.getDomEventTarget = function $goog$ime$dom$TextInput$$getDomEventTarget$() {
  return this.getEditableElement()
};
goog.ime.dom.TextInput.prototype.getDomHelper = function $goog$ime$dom$TextInput$$getDomHelper$() {
  return this.domHelper_ || (this.domHelper_ = goog.dom.getDomHelper(this.getEditableElement()))
};
goog.ime.dom.TextInput.prototype.getEditableElement = function $goog$ime$dom$TextInput$$getEditableElement$() {
  return this.editableElement
};
goog.ime.dom.TextInput.prototype.getContainerElement = function $goog$ime$dom$TextInput$$getContainerElement$() {
  return this.containerElement
};
goog.ime.dom.TextInput.prototype.registerToken = function $goog$ime$dom$TextInput$$registerToken$(token) {
  this.idTokenMap_[token.getId()] = token
};
goog.ime.dom.TextInput.prototype.unregisterToken = function $goog$ime$dom$TextInput$$unregisterToken$(token) {
  delete this.idTokenMap_[token.getId()]
};
goog.ime.dom.TextInput.prototype.processTokens = function $goog$ime$dom$TextInput$$processTokens$(processorFn) {
  for(var id in this.idTokenMap_) {
    processorFn(this.idTokenMap_[id])
  }
};
goog.ime.dom.TextInput.prototype.listen = function $goog$ime$dom$TextInput$$listen$(eventTypes) {
  this.inputable || (this.isDelegation && !this.usesIframe && (!goog.userAgent.IE || goog.userAgent.isDocumentMode(9)) ? goog.ime.plugin.GlobalEventDelegate.delegateEvent(this.getDomEventTarget(), eventTypes, this.forwardEvent_, this) : this.eventHandler.listen(this.getDomEventTarget(), eventTypes, this.forwardEvent_, !1, this))
};
goog.ime.dom.TextInput.prototype.unlisten = function $goog$ime$dom$TextInput$$unlisten$(eventTypes) {
  this.inputable || (this.isDelegation && (!goog.userAgent.IE || goog.userAgent.isDocumentMode(9)) ? goog.ime.plugin.GlobalEventDelegate.removeDelegateEvent(this.getDomEventTarget(), eventTypes, this.forwardEvent_, this) : this.eventHandler.unlisten(this.getDomEventTarget(), eventTypes, this.forwardEvent_, !1, this))
};
goog.ime.dom.TextInput.prototype.forwardEvent_ = function $goog$ime$dom$TextInput$$forwardEvent_$(e) {
  this.dispatchEvent(e) && (e.stopPropagation(), e.preventDefault())
};
goog.ime.dom.TextInput.prototype.forwardShortcutEvent_ = function $goog$ime$dom$TextInput$$forwardShortcutEvent_$(e) {
  e.type = goog.ui.KeyboardShortcutHandler.EventType.SHORTCUT_TRIGGERED;
  this.dispatchEvent(e) && e.preventDefault()
};
goog.ime.dom.TextInput.prototype.listenShortcut = function $goog$ime$dom$TextInput$$listenShortcut$(shortcut, opt_commandType) {
  this.keyboardShortcutHandler_ || (this.keyboardShortcutHandler_ = new goog.ime.common.KeyboardShortcutHandler(this), this.keyboardShortcutHandler_.setAllShortcutsAreGlobal(!0));
  var shortcutKeyEventId = opt_commandType || shortcut, shortcutEventType = this.keyboardShortcutHandler_.getEventType(shortcutKeyEventId);
  this.keyboardShortcutHandler_.isShortcutRegistered(shortcut) || (this.keyboardShortcutHandler_.registerShortcut(shortcutKeyEventId, shortcut), this.eventHandler.listen(this.keyboardShortcutHandler_, shortcutEventType, this.forwardShortcutEvent_, !1, this))
};
goog.ime.dom.TextInput.prototype.unlistenShortcut = function $goog$ime$dom$TextInput$$unlistenShortcut$(shortcut, opt_commandType) {
  if(this.keyboardShortcutHandler_) {
    var shortcutKeyEventId = opt_commandType || shortcut;
    if(this.keyboardShortcutHandler_.isShortcutRegistered(shortcut)) {
      var shortcutEventType = this.keyboardShortcutHandler_.getEventType(shortcutKeyEventId);
      this.keyboardShortcutHandler_.unregisterShortcut(shortcutKeyEventId, shortcut);
      this.eventHandler.unlisten(this.keyboardShortcutHandler_, shortcutEventType, this.forwardShortcutEvent_, !1, this)
    }
  }
};
goog.ime.dom.TextInput.prototype.refreshCaret = function $goog$ime$dom$TextInput$$refreshCaret$() {
};
goog.ime.dom.TextInput.prototype.getSelectionToken = goog.functions.NULL;
goog.ime.dom.TextInput.prototype.isRangeCollapsed = goog.functions.TRUE;
goog.ime.dom.TextInput.prototype.setCaret = function $goog$ime$dom$TextInput$$setCaret$() {
};
goog.ime.dom.TextInput.prototype.selectToken = function $goog$ime$dom$TextInput$$selectToken$() {
};
goog.ime.dom.TextInput.prototype.isEditable = goog.functions.TRUE;
goog.ime.dom.TextInput.prototype.hasFocus = goog.functions.TRUE;
goog.ime.dom.TextInput.prototype.isRightToLeft = goog.functions.FALSE;
goog.ime.dom.TextInput.prototype.getDirection = goog.functions.NULL;
goog.ime.dom.TextInput.prototype.setDirection = goog.functions.FALSE;
goog.ime.dom.TextInput.prototype.maybeChangeDirection = function $goog$ime$dom$TextInput$$maybeChangeDirection$(dir) {
  this.setDirection(dir)
};
goog.ime.plugin.lang.DefaultPluginProxy = function $goog$ime$plugin$lang$DefaultPluginProxy$() {
  goog.ime.ui.PluginProxy.call(this);
  this.alphaQuoteRegExp = /[a-z]/i
};
goog.inherits(goog.ime.plugin.lang.DefaultPluginProxy, goog.ime.ui.PluginProxy);
goog.ime.plugin.lang.DefaultPluginProxy.prototype.isValidCharKeyInternal = function $goog$ime$plugin$lang$DefaultPluginProxy$$isValidCharKeyInternal$(editor, e, ch) {
  return this.isValidChar(ch)
};
goog.ime.plugin.lang.DefaultPluginProxy.prototype.isValidChar = function $goog$ime$plugin$lang$DefaultPluginProxy$$isValidChar$(ch) {
  return this.alphaQuoteRegExp.test(ch)
};
goog.ime.plugin.lang.DefaultPluginProxy.prototype.isPunctuation = function $goog$ime$plugin$lang$DefaultPluginProxy$$isPunctuation$(ch) {
  if("" != ch && !this.isValidChar(ch)) {
    var digitRegExp = /[0-9 ]/;
    return!digitRegExp.test(ch)
  }
  return!1
};
goog.ime.plugin.lang.DefaultPluginProxy.prototype.getNativeNumber = function $goog$ime$plugin$lang$DefaultPluginProxy$$getNativeNumber$(index, langCodePair) {
  var transliterator = goog.ime.plugin.lang.StaticTransliterator.getDefault();
  return transliterator.getNativeNumber(index, langCodePair)
};
goog.ime.plugin.lang.DefaultPluginProxy.prototype.getStaticMappingString = function $goog$ime$plugin$lang$DefaultPluginProxy$$getStaticMappingString$(str, inputTool) {
  var transliterator = goog.ime.plugin.lang.StaticTransliterator.getDefault();
  return transliterator.getMappingChar(inputTool, str)
};
goog.ime.plugin.lang.DefaultPluginProxy.prototype.getTranslatedPunctuation = function $goog$ime$plugin$lang$DefaultPluginProxy$$getTranslatedPunctuation$(e, inputTool, editor) {
  var ch = 0 != e.charCode ? String.fromCharCode(e.charCode) : "";
  if("." == ch && editor.hasFeature(goog.ime.plugin.lang.InputMethodFeatureConfig.Feature.DANDA_MARK)) {
    var editorText = editor.getEditorText();
    return 1 < editorText.length ? "\u0964" : "."
  }
  var mappedChar = this.getMappingChar(inputTool, e);
  return mappedChar || ch
};
goog.ime.plugin.lang.DefaultPluginProxy.prototype.getMappingChar = function $goog$ime$plugin$lang$DefaultPluginProxy$$getMappingChar$(inputTool, e) {
  var ch = String.fromCharCode(e.charCode);
  if(!this.isValidChar(ch)) {
    var transliterator = goog.ime.plugin.lang.StaticTransliterator.getDefault();
    return transliterator.getMappingChar(inputTool, ch)
  }
  return""
};
goog.ime.plugin.lang.DefaultPluginProxy.prototype.setValidCharacters = function $goog$ime$plugin$lang$DefaultPluginProxy$$setValidCharacters$(inputTool) {
  switch(inputTool.code) {
    case goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_AMHARIC:
    ;
    case goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_TIGRINYA:
      this.alphaQuoteRegExp = /[a-z`]/i;
      break;
    case goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_ARABIC:
      this.alphaQuoteRegExp = /[a-z`_\-\']/i;
      break;
    case goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HEBREW:
    ;
    case goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_RUSSIAN:
    ;
    case goog.ime.lang.InputToolCode.INPUTMETHOD_PINYIN_CHINESE_SIMPLIFIED:
    ;
    case goog.ime.lang.InputToolCode.INPUTMETHOD_ZHUYIN_CHINESE_TRADITIONAL:
      this.alphaQuoteRegExp = /[a-z\']/i;
      break;
    case goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_PERSIAN:
      this.alphaQuoteRegExp = /[a-z`\']/i;
      break;
    case goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_SERBIAN:
      this.alphaQuoteRegExp = /[a-z\u0106\u0107\u010c\u010d\u0110\u0111\u0160\u0161\u017d\u017e]/i;
      break;
    case goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_JAPANESE:
    ;
    case goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HIRAGANA:
      break;
    default:
      this.alphaQuoteRegExp = /[a-z]/i
  }
};
goog.ime.plugin.lang.DefaultPluginProxy.prototype.isCaseSensitive = goog.functions.TRUE;
goog.ime.plugin.lang.ChinesePluginProxy = function $goog$ime$plugin$lang$ChinesePluginProxy$() {
  goog.ime.plugin.lang.DefaultPluginProxy.call(this);
  this.isChinesePunctuation = this.isSBC = this.isChineseMode = !0;
  this.alphaQuoteRegExp = /[a-z\']/i
};
goog.inherits(goog.ime.plugin.lang.ChinesePluginProxy, goog.ime.plugin.lang.DefaultPluginProxy);
goog.ime.plugin.lang.ChinesePluginProxy.prototype.isActive = function $goog$ime$plugin$lang$ChinesePluginProxy$$isActive$() {
  return this.isChineseMode
};
goog.ime.plugin.lang.ChinesePluginProxy.prototype.getMappingChar = function $goog$ime$plugin$lang$ChinesePluginProxy$$getMappingChar$(inputTool, e) {
  var ch = String.fromCharCode(e.charCode);
  if((!this.isSBC || this.isChinesePunctuation) && (!this.isChineseMode || !this.isValidChar(ch) || "'" == ch)) {
    var transliterator = goog.ime.plugin.lang.StaticTransliterator.getDefault();
    return transliterator.getMappingChar(inputTool, ch, this.isSBC, this.isChinesePunctuation)
  }
  return""
};
goog.ime.plugin.lang.ChinesePluginProxy.prototype.isPunctuation = function $goog$ime$plugin$lang$ChinesePluginProxy$$isPunctuation$(ch) {
  if("" != ch && !this.isValidChar(ch)) {
    var otherRegExp = /[0-9 ,.<>]/;
    return!otherRegExp.test(ch)
  }
  return!1
};
goog.ime.plugin.lang.ChinesePluginProxy.prototype.isCaseSensitive = goog.functions.FALSE;
goog.ime.plugin.lang.ChinesePluginProxy.prototype.switchInputMode = function $goog$ime$plugin$lang$ChinesePluginProxy$$switchInputMode$(commandType, textInput, inputTool) {
  var event;
  switch(commandType) {
    case goog.ime.plugin.CommandType.TOGGLE_SBC:
      this.isSBC = !this.isSBC;
      event = new goog.ime.api.ita.StatusBarEvent(commandType, inputTool, this.isSBC);
      textInput.dispatchEvent(event);
      break;
    case goog.ime.plugin.CommandType.TOGGLE_LANGUAGE:
      this.isChineseMode = !this.isChineseMode;
      event = new goog.ime.api.ita.StatusBarEvent(commandType, inputTool, this.isChineseMode);
      textInput.dispatchEvent(event);
      !this.isChineseMode && this.isChinesePunctuation && (this.isChinesePunctuation = !1, event = new goog.ime.api.ita.StatusBarEvent(goog.ime.plugin.CommandType.PUNCTUATION, inputTool, this.isChinesePunctuation), textInput.dispatchEvent(event));
      break;
    case goog.ime.plugin.CommandType.PUNCTUATION:
      this.isChineseMode && (this.isChinesePunctuation = !this.isChinesePunctuation, event = new goog.ime.api.ita.StatusBarEvent(goog.ime.plugin.CommandType.PUNCTUATION, inputTool, this.isChinesePunctuation), textInput.dispatchEvent(event))
  }
};
goog.ime.plugin.lang.PopupEditor = function $goog$ime$plugin$lang$PopupEditor$(dom, opt_renderer) {
  goog.ime.ui.CustomPopupMenu.call(this, dom, opt_renderer, []);
  this.suggestionShortcutMap_ = goog.object.create(goog.events.KeyCodes.SPACE, 0);
  this.isForcedHide_ = !1;
  this.childrenData = [];
  this.currentStart = 0;
  this.canFetchMore_ = !0;
  this.draggable_ = this.disableHover_ = !1;
  this.dragger_ = null;
  this.cursorPos = 0;
  this.textInput_ = this.rightTextSpan = this.leftTextSpan = this.cursorSpan_ = null;
  this.pluginProxy = new goog.ime.plugin.lang.DefaultPluginProxy;
  this.features_ = [];
  this.actionKeyMap_ = {};
  this.inputTool = null;
  this.setActionKeyFn(goog.bind(this.isActionKey, this))
};
goog.inherits(goog.ime.plugin.lang.PopupEditor, goog.ime.ui.CustomPopupMenu);
goog.ime.plugin.lang.PopupEditor.NAVCOMMAND = {PAGE_DOWN:"pgDn", PAGE_UP:"pgUp"};
goog.ime.plugin.lang.PopupEditor.prototype.logger = goog.debug.Logger.getLogger("goog.ime.plugin.lang.PopupEditor");
goog.ime.plugin.lang.PopupEditor.prototype.onEnter_ = function $goog$ime$plugin$lang$PopupEditor$$onEnter_$(e) {
  this.disableHover_ && e.preventDefault()
};
goog.ime.plugin.lang.PopupEditor.prototype.temporarilyDisableHover_ = function $goog$ime$plugin$lang$PopupEditor$$temporarilyDisableHover_$() {
  this.disableHover_ = !0;
  goog.Timer.callOnce(function() {
    this.disableHover_ = !1
  }, 0, this)
};
goog.ime.plugin.lang.PopupEditor.prototype.setChildrenData = function $goog$ime$plugin$lang$PopupEditor$$setChildrenData$(childrenData) {
  this.childrenData = goog.array.clone(childrenData);
  this.canFetchMore_ = !0;
  if(this.hasFeature(goog.ime.plugin.lang.InputMethodFeatureConfig.Feature.AUTO_SELECTION)) {
    for(var editorText = this.getEditorText(), originalSugItem = new goog.ime.plugin.lang.PrefixSuggestionItem(editorText, editorText.length), i = 0;i < this.childrenData.length;i++) {
      var childData = this.childrenData[i], sugText = childData.getText();
      if(sugText == editorText) {
        if(i < this.pageSize_) {
          return
        }
        goog.array.remove(this.childrenData, childData);
        break
      }
    }
    goog.array.insertAt(this.childrenData, originalSugItem, this.pageSize_ - 1)
  }
};
goog.ime.plugin.lang.PopupEditor.prototype.setPageSize = function $goog$ime$plugin$lang$PopupEditor$$setPageSize$(pageSize) {
  this.pageSize_ = pageSize
};
goog.ime.plugin.lang.PopupEditor.prototype.reshowSuggestions = function $goog$ime$plugin$lang$PopupEditor$$reshowSuggestions$(start) {
  this.showFrom(start);
  this.highlightFirst()
};
goog.ime.plugin.lang.PopupEditor.prototype.createDom = function $goog$ime$plugin$lang$PopupEditor$$createDom$() {
  goog.ime.plugin.lang.PopupEditor.superClass_.createDom.call(this);
  var dom = this.getDomHelper(), element = this.getElement(), editorCss = this.getRenderer().getCssClass(), tableCss = editorCss + "-table", containerTable = goog.dom.createTable(1, 1);
  goog.dom.classes.add(containerTable, tableCss);
  var cellCss = editorCss + "-td", containerCell = containerTable.rows[0].cells[0];
  goog.dom.classes.add(containerCell, cellCss);
  var inputCss = editorCss + "-input", logoCss = editorCss + "-logo", topTable = dom.htmlToDocumentFragment('<TABLE style="width:100%;"><TBODY><TR><TD style="width:100%;"></TD><TD width="63px"></TD></TR></TBODY></TABLE>'), topTableRow = dom.getElementsByTagNameAndClass("tr", null, topTable)[0];
  this.textEditorElement = dom.createDom("div", inputCss);
  this.leftTextSpan = goog.dom.createDom(goog.dom.TagName.SPAN);
  goog.dom.setTextContent(this.leftTextSpan, "");
  dom.appendChild(this.textEditorElement, this.leftTextSpan);
  this.cursorSpan_ = this.createTextEditorSpan_("ita-popupeditor-cursor");
  dom.appendChild(this.textEditorElement, this.cursorSpan_);
  this.rightTextSpan = goog.dom.createDom(goog.dom.TagName.SPAN);
  goog.dom.setTextContent(this.rightTextSpan, "");
  dom.appendChild(this.textEditorElement, this.rightTextSpan);
  var logoElement = dom.createDom("div", logoCss);
  dom.appendChild(topTableRow.firstChild, this.textEditorElement);
  dom.appendChild(topTableRow.lastChild, logoElement);
  dom.appendChild(containerCell, topTable);
  var navButtonCss = editorCss + "-navbutton";
  this.pageDownButton_ = new goog.ui.CustomButton(goog.dom.createDom("div", editorCss + "-pagedown " + navButtonCss));
  this.pageDownButton_.setValue(goog.ime.plugin.lang.PopupEditor.NAVCOMMAND.PAGE_DOWN);
  this.pageUpButton_ = new goog.ui.CustomButton(goog.dom.createDom("div", editorCss + "-pageup " + navButtonCss));
  this.pageUpButton_.setValue(goog.ime.plugin.lang.PopupEditor.NAVCOMMAND.PAGE_UP);
  var navCss = editorCss + "-nav";
  this.navContainer_ = new goog.ui.Container(goog.ui.Container.Orientation.HORIZONTAL, goog.ui.ContainerRenderer.getCustomRenderer(goog.ui.ContainerRenderer, navCss));
  this.navContainer_.createDom();
  this.navContainer_.addChild(this.pageUpButton_, !0);
  this.pageUpButton_.setEnabled(!1);
  this.navContainer_.addChild(this.pageDownButton_, !0);
  this.navContainer_.setFocusable(!1);
  this.contentElement_ = dom.createDom("div", editorCss + "-content");
  var bottomTable = dom.htmlToDocumentFragment('<TABLE style="width:100%;"><TBODY><TR><TD style="width:100%;"></TD><TD width="54px"></TD></TR></TBODY></TABLE>'), bottomTableRow = dom.getElementsByTagNameAndClass("tr", null, bottomTable)[0];
  dom.appendChild(bottomTableRow.firstChild, this.contentElement_);
  dom.appendChild(bottomTableRow.lastChild, this.navContainer_.getElement());
  dom.appendChild(containerCell, bottomTable);
  dom.appendChild(element, containerTable);
  if(this.inputTool && this.inputTool.isRightToLeft()) {
    var rtlCSS = editorCss + "-rtl";
    goog.dom.classes.add(element, rtlCSS);
    goog.dom.classes.add(containerTable, rtlCSS);
    goog.dom.classes.add(topTable, rtlCSS);
    goog.dom.classes.add(bottomTable, rtlCSS);
    goog.dom.classes.add(this.textEditorElement, rtlCSS);
    goog.dom.classes.add(bottomTableRow.firstChild, rtlCSS)
  }
};
goog.ime.plugin.lang.PopupEditor.prototype.createTextEditorSpan_ = function $goog$ime$plugin$lang$PopupEditor$$createTextEditorSpan_$(opt_className) {
  var domHelper = this.getDomHelper(), editorCss = this.getRenderer().getCssClass(), span = domHelper.createDom("span", editorCss + "-editor-span");
  goog.dom.classes.add(span, opt_className);
  return span
};
goog.ime.plugin.lang.PopupEditor.prototype.enterDocument = function $goog$ime$plugin$lang$PopupEditor$$enterDocument$() {
  goog.ime.plugin.lang.PopupEditor.superClass_.enterDocument.call(this);
  this.navContainer_.enterDocument();
  this.navContainer_.setVisible(!1);
  this.navContainer_.addEventListener(goog.ui.Component.EventType.ACTION, this.handleNav_, !1, this);
  this.addEventListener(goog.ui.Component.EventType.HIDE, this.onHide_, !1, this);
  this.addEventListener(goog.ui.Component.EventType.ENTER, this.onEnter_, !1, this);
  this.setVisible(!1, !0);
  this.setDraggable(!0);
  this.setFocusableChildrenAllowed(!1);
  this.setFocusable(!1)
};
goog.ime.plugin.lang.PopupEditor.prototype.getContentElement = function $goog$ime$plugin$lang$PopupEditor$$getContentElement$() {
  return this.contentElement_ || this.getElement()
};
goog.ime.plugin.lang.PopupEditor.prototype.getPluginProxy = function $goog$ime$plugin$lang$PopupEditor$$getPluginProxy$() {
  return this.pluginProxy
};
goog.ime.plugin.lang.PopupEditor.prototype.handleChildMouseEvents = function $goog$ime$plugin$lang$PopupEditor$$handleChildMouseEvents$(e) {
  var retVal = goog.ime.plugin.lang.PopupEditor.superClass_.handleChildMouseEvents.call(this, e);
  this.textInput_ && this.containsElement(document.activeElement) && this.textInput_.setFocus();
  return retVal
};
goog.ime.plugin.lang.PopupEditor.prototype.handleKeyEventInternal = function $goog$ime$plugin$lang$PopupEditor$$handleKeyEventInternal$(e) {
  var m = "handleKeyEventInternal called:";
  if(!this.pluginProxy) {
    return!1
  }
  if(this.pluginProxy.isQueryKey(this, e)) {
    return this.pluginProxy.handleQueryKey(this, e)
  }
  if(this.pluginProxy.isRevertKey(this, e)) {
    return this.handleRevertKey(e)
  }
  if(this.pluginProxy.isHideKey(this, e)) {
    return this.logger.info(m + "Hide key pressed"), this.commitEditorText(!1)
  }
  if(this.pluginProxy.isCommitKey(this, e)) {
    return this.handleCommitKey(e)
  }
  var isCharacterKey = 0 != e.charCode, ch = isCharacterKey ? String.fromCharCode(e.charCode) : "", isValidChar = this.pluginProxy.isValidCharKey(this, e);
  this.logger.fine(m + "Character:" + ch + ":" + isValidChar);
  if(isCharacterKey) {
    if(0 < this.getChildCount() && goog.string.isNumeric(ch)) {
      return this.logger.info(m + "Numeric key triggered selection"), this.selectSuggestion(goog.string.toNumber(ch) - 1)
    }
    if(isValidChar) {
      return this.handleValidChar(ch)
    }
  }
  if(0 > this.getHighlightedIndex() && goog.object.containsKey(this.suggestionShortcutMap_, e.keyCode)) {
    return this.logger.info(m + "Selecting suggestion on shortcut key."), this.hasFeature(goog.ime.plugin.lang.InputMethodFeatureConfig.Feature.PRE_STATIC_MAPPING) && this.handleStaticMapping_(e) ? !0 : this.selectSuggestion(this.suggestionShortcutMap_[e.keyCode])
  }
  if(e.keyCode in this.actionKeyMap_) {
    return this.actionKeyMap_[e.keyCode]()
  }
  if(this.pluginProxy.isPunctuation(ch)) {
    var punc = this.pluginProxy.getTranslatedPunctuation(e, this.inputTool, this);
    if(this.hasFeature(goog.ime.plugin.lang.InputMethodFeatureConfig.Feature.AUTO_SELECTION) && !this.setAutoSelectionText()) {
      return!0
    }
    this.appendChar(punc);
    return this.commitEditorText(!0)
  }
  if(this.hasFeature(goog.ime.plugin.lang.InputMethodFeatureConfig.Feature.PRE_STATIC_MAPPING) && this.handleStaticMapping_(e)) {
    return!0
  }
  this.logger.fine(m + "Letting popupmenu handle the key");
  var retVal = goog.ime.plugin.lang.PopupEditor.superClass_.handleKeyEventInternal.call(this, e);
  this.logger.info("retVal:" + retVal);
  return retVal
};
goog.ime.plugin.lang.PopupEditor.prototype.ignoreEvent = function $goog$ime$plugin$lang$PopupEditor$$ignoreEvent$(e) {
  return!!e.charCode && !this.pluginProxy.isValidCharKey(this, e)
};
goog.ime.plugin.lang.PopupEditor.prototype.highlightNext = function $goog$ime$plugin$lang$PopupEditor$$highlightNext$() {
  this.getHighlightedIndex() == this.getChildCount() - 1 ? this.showNextPage() : goog.ime.plugin.lang.PopupEditor.superClass_.highlightNext.call(this)
};
goog.ime.plugin.lang.PopupEditor.prototype.highlightPrevious = function $goog$ime$plugin$lang$PopupEditor$$highlightPrevious$() {
  0 == this.getHighlightedIndex() ? this.showPreviousPage() && this.highlightLast() : goog.ime.plugin.lang.PopupEditor.superClass_.highlightPrevious.call(this)
};
goog.ime.plugin.lang.PopupEditor.prototype.getEditableElement = function $goog$ime$plugin$lang$PopupEditor$$getEditableElement$() {
  return this.textEditorElement
};
goog.ime.plugin.lang.PopupEditor.prototype.getCaret = function $goog$ime$plugin$lang$PopupEditor$$getCaret$() {
  return goog.dom.Range.createCaret(this.textEditorElement, this.cursorPos)
};
goog.ime.plugin.lang.PopupEditor.prototype.setCaret = function $goog$ime$plugin$lang$PopupEditor$$setCaret$(offset) {
  var text = goog.dom.getTextContent(this.leftTextSpan) + goog.dom.getTextContent(this.rightTextSpan), len = text.length, offsetIndex = goog.isBoolean(offset) ? offset ? 0 : len : offset, offsetIndex = (offsetIndex + len + 1) % (len + 1);
  if(0 <= offsetIndex && offsetIndex != this.cursorPos) {
    var leftText = text.slice(0, offsetIndex);
    goog.dom.setTextContent(this.leftTextSpan, leftText);
    var rightText = text.slice(offsetIndex);
    goog.dom.setTextContent(this.rightTextSpan, rightText);
    this.cursorPos = offsetIndex
  }
};
goog.ime.plugin.lang.PopupEditor.prototype.getQueryText = function $goog$ime$plugin$lang$PopupEditor$$getQueryText$() {
  var text = this.getEditorText();
  0 < this.cursorPos && (text = text.slice(0, this.cursorPos));
  var hasValidChars = -1 < goog.array.findIndex(text.split(""), this.pluginProxy.isValidChar, this.pluginProxy), text = hasValidChars ? text : this.getEditorText();
  return this.pluginProxy.isCaseSensitive() ? text : text.toLowerCase()
};
goog.ime.plugin.lang.PopupEditor.prototype.getEditorText = function $goog$ime$plugin$lang$PopupEditor$$getEditorText$() {
  var text = goog.dom.getTextContent(this.textEditorElement) || "";
  return text
};
goog.ime.plugin.lang.PopupEditor.prototype.setEditorText = function $goog$ime$plugin$lang$PopupEditor$$setEditorText$(text) {
  this.clearEditorText();
  goog.dom.setTextContent(this.leftTextSpan, text);
  this.cursorPos = text.length;
  this.isVisible() && this.setCaret(!1)
};
goog.ime.plugin.lang.PopupEditor.prototype.modifyEditorText = function $goog$ime$plugin$lang$PopupEditor$$modifyEditorText$(oldText, newText) {
  var m = "modifyEditorText:";
  this.logger.info(m + "oldText:" + oldText + ":newText:" + newText);
  var editorText = this.pluginProxy.isCaseSensitive() ? this.getEditorText() : this.getEditorText().toLowerCase(), oldIndex = editorText.indexOf(oldText);
  this.logger.info(m + ["editorText", editorText, "this.cursorPos", this.cursorPos].join(":"));
  var moveCaret = oldIndex + oldText.length > this.cursorPos;
  if(0 <= oldIndex) {
    var newEditorText = editorText.replace(oldText, newText), newOffset = this.cursorPos + newText.length - (moveCaret ? 0 : oldText.length);
    this.setEditorText(newEditorText);
    this.disableSuggestions();
    this.setCaret(newOffset)
  }
};
goog.ime.plugin.lang.PopupEditor.prototype.commitEditorText = function $goog$ime$plugin$lang$PopupEditor$$commitEditorText$(success) {
  this.logger.info("commitEditorText(success):" + success);
  this.forceHide();
  this.dispatchEvent(success ? goog.ime.ui.PopupEditor.EventType.SUCCESS : goog.ime.ui.PopupEditor.EventType.DISCARD);
  return!0
};
goog.ime.plugin.lang.PopupEditor.prototype.onStage = function $goog$ime$plugin$lang$PopupEditor$$onStage$() {
  return this.isInDocument() && this.isVisible()
};
goog.ime.plugin.lang.PopupEditor.prototype.hide = function $goog$ime$plugin$lang$PopupEditor$$hide$() {
  goog.ime.plugin.lang.PopupEditor.superClass_.hide.call(this);
  if(this.hasFeature(goog.ime.plugin.lang.InputMethodFeatureConfig.Feature.PRECOMMIT)) {
    var timerEvent = new goog.ime.plugin.PreCommitTimerEvent(!0);
    this.dispatchEvent(timerEvent)
  }
};
goog.ime.plugin.lang.PopupEditor.prototype.forceHide = function $goog$ime$plugin$lang$PopupEditor$$forceHide$() {
  this.isForcedHide_ = !0;
  this.hide();
  this.isForcedHide_ = !1;
  this.cursorPos = 0
};
goog.ime.plugin.lang.PopupEditor.prototype.onHide_ = function $goog$ime$plugin$lang$PopupEditor$$onHide_$() {
  this.logger.info("Hide event forced: " + this.isForcedHide_);
  return this.isForcedHide_
};
goog.ime.plugin.lang.PopupEditor.prototype.selectSuggestion = function $goog$ime$plugin$lang$PopupEditor$$selectSuggestion$(index) {
  var menuItem = this.getChildAt(index);
  if(menuItem && menuItem.isEnabled()) {
    this.dispatchEvent(new goog.events.Event(goog.ui.Component.EventType.ACTION, menuItem))
  }else {
    if(this.hasFeature(goog.ime.plugin.lang.InputMethodFeatureConfig.Feature.PRECOMMIT) && (0 == this.getChildCount() || 0 == index)) {
      var queryText = this.getQueryText();
      if(queryText) {
        var precommitEvent = new goog.ime.plugin.PreCommitEvent(queryText);
        this.forceHide();
        this.dispatchEvent(precommitEvent)
      }
    }
  }
  return!0
};
goog.ime.plugin.lang.PopupEditor.prototype.handleNav_ = function $goog$ime$plugin$lang$PopupEditor$$handleNav_$(e) {
  var cmd = e.target && e.target.getValue();
  this.logger.info("handleNav_:command:" + cmd);
  var result = !1;
  switch(cmd) {
    case goog.ime.plugin.lang.PopupEditor.NAVCOMMAND.PAGE_DOWN:
      this.showNextPage();
      result = !0;
      break;
    case goog.ime.plugin.lang.PopupEditor.NAVCOMMAND.PAGE_UP:
      this.showPreviousPage(), result = !0
  }
  return result
};
goog.ime.plugin.lang.PopupEditor.prototype.showNextPage = function $goog$ime$plugin$lang$PopupEditor$$showNextPage$() {
  var len = this.childrenData.length, newStart = this.currentStart + this.pageSize_;
  if(newStart >= len && this.canFetchMore_) {
    var e = new goog.ime.ui.FetchSuggestionEvent(this.getQueryText(), newStart);
    this.canFetchMore_ = this.dispatchEvent(e);
    this.pageDownButton_.setEnabled(this.canFetchMore_);
    this.logger.info("More suggestions to fetch:" + this.canFetchMore_)
  }else {
    newStart >= len && !this.canFetchMore_ && (newStart = 0), 0 <= newStart && newStart < len && this.showFrom(newStart), this.highlightFirst()
  }
};
goog.ime.plugin.lang.PopupEditor.prototype.showPreviousPage = function $goog$ime$plugin$lang$PopupEditor$$showPreviousPage$() {
  var len = this.childrenData.length, newStart = this.currentStart - this.pageSize_;
  return 0 <= newStart && newStart < len ? (this.showFrom(newStart), this.highlightFirst(), !0) : !1
};
goog.ime.plugin.lang.PopupEditor.prototype.showFrom = function $goog$ime$plugin$lang$PopupEditor$$showFrom$(start) {
  var len = this.childrenData.length;
  if(0 > start || start >= len) {
    this.logger.info("Invalid start:len:" + start + ":" + len)
  }else {
    this.currentStart = start;
    var nextStart = this.currentStart + this.pageSize_;
    this.pageUpButton_.setEnabled(0 < this.currentStart);
    var canPageDown = nextStart < len || this.canFetchMore_ && nextStart >= len;
    this.pageDownButton_.setEnabled(canPageDown);
    var rtl = this.inputTool ? this.inputTool.isRightToLeft() : !1, rightTopPosition = rtl ? this.getRightTopPosition_() : null;
    this.removeChildren(!0);
    this.displayCandidates();
    this.temporarilyDisableHover_();
    this.navContainer_.setVisible(!0);
    rtl && this.setRightTopPosition_(rightTopPosition)
  }
};
goog.ime.plugin.lang.PopupEditor.prototype.getDisplayContent = function $goog$ime$plugin$lang$PopupEditor$$getDisplayContent$(childData, index) {
  var content = childData.getDisplayContent(index);
  if(this.hasFeature(goog.ime.plugin.lang.InputMethodFeatureConfig.Feature.NATIVE_NUMBER)) {
    var splitPos = content.indexOf("."), indexStr = content.slice(0, splitPos), content = content.slice(splitPos), indexStr = this.pluginProxy.getNativeNumber(indexStr, this.inputTool.getLanguagePair()), content = indexStr + content
  }
  return content
};
goog.ime.plugin.lang.PopupEditor.prototype.showErrorMessage = function $goog$ime$plugin$lang$PopupEditor$$showErrorMessage$(msg, opt_style) {
  this.clearSuggestions();
  var msgMenuItem = this.addMenuItem(msg, "", void 0, opt_style);
  msgMenuItem.setEnabled(!1)
};
goog.ime.plugin.lang.PopupEditor.prototype.disableSuggestions = function $goog$ime$plugin$lang$PopupEditor$$disableSuggestions$() {
  this.forEachChild(function(menuItem) {
    menuItem.setEnabled(!1)
  });
  this.childrenData = [];
  this.canFetchMore_ = !1;
  this.pageUpButton_.setEnabled(!1);
  this.pageDownButton_.setEnabled(!1)
};
goog.ime.plugin.lang.PopupEditor.prototype.clearSuggestions = function $goog$ime$plugin$lang$PopupEditor$$clearSuggestions$() {
  this.removeChildren(!0);
  this.navContainer_.setVisible(!1)
};
goog.ime.plugin.lang.PopupEditor.prototype.reset = function $goog$ime$plugin$lang$PopupEditor$$reset$() {
  this.logger.info("Reset the popup editor");
  this.setEditorText("");
  this.clearSuggestions()
};
goog.ime.plugin.lang.PopupEditor.prototype.onDocClick = function $goog$ime$plugin$lang$PopupEditor$$onDocClick$(e) {
  this.isVisible() && !this.containsElement(e.target) && this.commitEditorText(!1)
};
goog.ime.plugin.lang.PopupEditor.prototype.setDraggable = function $goog$ime$plugin$lang$PopupEditor$$setDraggable$(draggable) {
  (this.draggable_ = draggable) && !this.dragger_ && this.getElement() ? this.dragger_ = new goog.fx.Dragger(this.getElement()) : !this.draggable_ && this.dragger_ && (this.dragger_.dispose(), this.dragger_ = null)
};
goog.ime.plugin.lang.PopupEditor.prototype.appendChar = function $goog$ime$plugin$lang$PopupEditor$$appendChar$(c, opt_pos) {
  opt_pos && this.setCaret(opt_pos);
  var leftText = goog.dom.getTextContent(this.leftTextSpan), leftText = leftText + c;
  goog.dom.setTextContent(this.leftTextSpan, leftText);
  this.cursorPos++
};
goog.ime.plugin.lang.PopupEditor.prototype.deleteChar = function $goog$ime$plugin$lang$PopupEditor$$deleteChar$(position) {
  if(position != this.cursorPos && 0 <= position) {
    var leftText = goog.dom.getTextContent(this.leftTextSpan);
    if(position < leftText.length) {
      leftText = goog.string.removeAt(leftText, position, 1), goog.dom.setTextContent(this.leftTextSpan, leftText), this.cursorPos--
    }else {
      var position = position - leftText.length - 1, rightText = goog.dom.getTextContent(this.rightTextSpan);
      position < rightText.length && (rightText = goog.string.removeAt(rightText, position, 1), goog.dom.setTextContent(this.rightTextSpan, rightText))
    }
  }
};
goog.ime.plugin.lang.PopupEditor.prototype.clearEditorText = function $goog$ime$plugin$lang$PopupEditor$$clearEditorText$() {
  goog.dom.removeChildren(this.textEditorElement);
  goog.dom.setTextContent(this.leftTextSpan, "");
  goog.dom.setTextContent(this.rightTextSpan, "");
  this.textEditorElement.appendChild(this.leftTextSpan);
  this.textEditorElement.appendChild(this.cursorSpan_);
  this.textEditorElement.appendChild(this.rightTextSpan);
  this.cursorPos = 0
};
goog.ime.plugin.lang.PopupEditor.prototype.setTextInput = function $goog$ime$plugin$lang$PopupEditor$$setTextInput$(textInput) {
  this.textInput_ = textInput
};
goog.ime.plugin.lang.PopupEditor.prototype.getTransliteratableText = function $goog$ime$plugin$lang$PopupEditor$$getTransliteratableText$(text) {
  return text
};
goog.ime.plugin.lang.PopupEditor.prototype.isActionKey = function $goog$ime$plugin$lang$PopupEditor$$isActionKey$(e) {
  return e.keyCode == goog.events.KeyCodes.SPACE
};
goog.ime.plugin.lang.PopupEditor.prototype.handleRevertKey = function $goog$ime$plugin$lang$PopupEditor$$handleRevertKey$(e) {
  var isBackspace = e.keyCode == goog.events.KeyCodes.BACKSPACE;
  return isBackspace ? (this.deleteChar(this.cursorPos - 1), !0) : !1
};
goog.ime.plugin.lang.PopupEditor.prototype.handleCommitKey = function $goog$ime$plugin$lang$PopupEditor$$handleCommitKey$(e) {
  this.hasFeature(goog.ime.plugin.lang.InputMethodFeatureConfig.Feature.AUTO_SELECTION) && this.setAutoSelectionText();
  var result = this.commitEditorText(!0);
  return e.keyCode == goog.events.KeyCodes.ENTER ? this.hasFeature(goog.ime.plugin.lang.InputMethodFeatureConfig.Feature.ENTER_EVENT_TO_BROWSER) ? !1 : result : result
};
goog.ime.plugin.lang.PopupEditor.prototype.handleValidChar = function $goog$ime$plugin$lang$PopupEditor$$handleValidChar$(ch) {
  this.appendChar(ch);
  return!0
};
goog.ime.plugin.lang.PopupEditor.prototype.displayCandidates = function $goog$ime$plugin$lang$PopupEditor$$displayCandidates$() {
  for(var len = this.childrenData.length, pageSize = this.pageSize_, i = 0;i < pageSize;i++) {
    var childIndex = this.currentStart + i;
    if(childIndex < len) {
      var childData = this.childrenData[childIndex];
      this.addMenuItem(this.getDisplayContent(childData, i), childData)
    }
  }
};
goog.ime.plugin.lang.PopupEditor.prototype.registerDefaultActionKeys_ = function $goog$ime$plugin$lang$PopupEditor$$registerDefaultActionKeys_$() {
  var keyPrevious = goog.events.KeyCodes.LEFT, keyNext = goog.events.KeyCodes.RIGHT;
  this.inputTool && this.inputTool.isRightToLeft() && (keyPrevious = goog.events.KeyCodes.RIGHT, keyNext = goog.events.KeyCodes.LEFT);
  this.registerActionKey(keyPrevious, goog.functions.withReturnValue(goog.bind(this.highlightPrevious, this), !0));
  this.registerActionKey(keyNext, goog.functions.withReturnValue(goog.bind(this.highlightNext, this), !0));
  this.registerActionKey(goog.events.KeyCodes.PAGE_UP, goog.functions.withReturnValue(goog.bind(this.showPreviousPage, this), !0));
  this.registerActionKey(goog.events.KeyCodes.PAGE_DOWN, goog.functions.withReturnValue(goog.bind(this.showNextPage, this), !0));
  this.registerActionKey(goog.events.KeyCodes.UP, goog.functions.withReturnValue(goog.bind(this.showPreviousPage, this), !0));
  this.registerActionKey(goog.events.KeyCodes.DOWN, goog.functions.withReturnValue(goog.bind(this.showNextPage, this), !0));
  this.registerActionKey(goog.events.KeyCodes.HOME, goog.functions.TRUE);
  this.registerActionKey(goog.events.KeyCodes.END, goog.functions.TRUE);
  this.registerActionKey(goog.events.KeyCodes.TAB, goog.functions.TRUE)
};
goog.ime.plugin.lang.PopupEditor.prototype.registerActionKey = function $goog$ime$plugin$lang$PopupEditor$$registerActionKey$(code, fn) {
  this.actionKeyMap_[code] = fn
};
goog.ime.plugin.lang.PopupEditor.prototype.setFeatures = function $goog$ime$plugin$lang$PopupEditor$$setFeatures$(features) {
  this.features_ = goog.array.concat(this.features_, features)
};
goog.ime.plugin.lang.PopupEditor.prototype.hasFeature = function $goog$ime$plugin$lang$PopupEditor$$hasFeature$(feature) {
  return goog.array.contains(this.features_, feature)
};
goog.ime.plugin.lang.PopupEditor.prototype.setInputTool = function $goog$ime$plugin$lang$PopupEditor$$setInputTool$(inputTool) {
  var features = goog.ime.plugin.lang.InputMethodFeatureConfig.getFeatures(inputTool);
  this.inputTool = inputTool;
  this.pluginProxy.setValidCharacters && this.pluginProxy.setValidCharacters(inputTool);
  this.setFeatures(features);
  this.registerDefaultActionKeys_()
};
goog.ime.plugin.lang.PopupEditor.prototype.updateSuggestions = function $goog$ime$plugin$lang$PopupEditor$$updateSuggestions$(suggestion, start, num) {
  this.setPageSize(num);
  this.setChildrenData(suggestion.getSuggestions());
  this.reshowSuggestions(start)
};
goog.ime.plugin.lang.PopupEditor.prototype.updateEditorText = function $goog$ime$plugin$lang$PopupEditor$$updateEditorText$(sugItem) {
  var sugText = sugItem.getText();
  this.hasFeature(goog.ime.plugin.lang.InputMethodFeatureConfig.Feature.AUTO_SELECTION) && (sugText += " ");
  this.setEditorText(sugText);
  return!0
};
goog.ime.plugin.lang.PopupEditor.prototype.getAutoSelectionText = function $goog$ime$plugin$lang$PopupEditor$$getAutoSelectionText$() {
  var index = this.getHighlightedIndex(), index = 0 > index ? 0 : index, sugMenuItem = this.getChildAt(index);
  if(!sugMenuItem) {
    return""
  }
  var sugText = sugMenuItem.getValue().getText();
  return sugText
};
goog.ime.plugin.lang.PopupEditor.prototype.setAutoSelectionText = function $goog$ime$plugin$lang$PopupEditor$$setAutoSelectionText$() {
  var selectionText = this.getAutoSelectionText();
  return selectionText ? (this.setEditorText(selectionText), !0) : !1
};
goog.ime.plugin.lang.PopupEditor.prototype.isPreCommit = function $goog$ime$plugin$lang$PopupEditor$$isPreCommit$() {
  return this.hasFeature(goog.ime.plugin.lang.InputMethodFeatureConfig.Feature.PRECOMMIT)
};
goog.ime.plugin.lang.PopupEditor.prototype.getRightTopPosition_ = function $goog$ime$plugin$lang$PopupEditor$$getRightTopPosition_$() {
  var element = this.getElement(), size = goog.style.getSize(element), leftTopPosition = goog.style.getPageOffset(element);
  return new goog.math.Coordinate(leftTopPosition.x + size.width, leftTopPosition.y)
};
goog.ime.plugin.lang.PopupEditor.prototype.setRightTopPosition_ = function $goog$ime$plugin$lang$PopupEditor$$setRightTopPosition_$(rightTopPosition) {
  if(rightTopPosition) {
    for(var adjustedRounds = 0, element = this.getElement();5 > adjustedRounds++;) {
      var size = goog.style.getSize(element), leftTopPosition = new goog.math.Coordinate(rightTopPosition.x - size.width, rightTopPosition.y);
      goog.style.setPosition(element, leftTopPosition);
      if(this.getRightTopPosition_().width == rightTopPosition.width) {
        break
      }
    }
  }
};
goog.ime.plugin.lang.PopupEditor.prototype.handleStaticMapping_ = function $goog$ime$plugin$lang$PopupEditor$$handleStaticMapping_$(e) {
  var key = String.fromCharCode(e.keyCode || e.charCode), precedingText = this.getEditorText(), mappingText = this.pluginProxy.getStaticMappingString(precedingText + key, this.inputTool);
  return mappingText ? (this.setEditorText(mappingText), !0) : !1
};
goog.ime.plugin.lang.PopupEditor.prototype.inCompositionState = function $goog$ime$plugin$lang$PopupEditor$$inCompositionState$() {
  return!1
};
goog.ime.plugin.lang.ChinesePopupEditor = function $goog$ime$plugin$lang$ChinesePopupEditor$(dom, opt_renderer) {
  goog.ime.plugin.lang.PopupEditor.call(this, dom, opt_renderer);
  this.translitedPos = 0;
  this.pluginProxy = new goog.ime.plugin.lang.ChinesePluginProxy;
  this.editorChangeHistory_ = [];
  this.registerActionKey(goog.events.KeyCodes.COMMA, goog.functions.withReturnValue(goog.bind(this.showPreviousPage, this), !0));
  this.registerActionKey(goog.events.KeyCodes.PERIOD, goog.functions.withReturnValue(goog.bind(this.showNextPage, this), !0))
};
goog.inherits(goog.ime.plugin.lang.ChinesePopupEditor, goog.ime.plugin.lang.PopupEditor);
goog.ime.plugin.lang.ChinesePopupEditor.prototype.logger = goog.debug.Logger.getLogger("goog.ime.plugin.lang.ChinesePopupEditor");
goog.ime.plugin.lang.ChinesePopupEditor.prototype.handleValidChar = function $goog$ime$plugin$lang$ChinesePopupEditor$$handleValidChar$(ch) {
  if("'" == ch) {
    var text = this.getQueryText();
    if(!goog.string.isEmptySafe(text) && goog.string.endsWith(text, "'")) {
      return!0
    }
  }
  return goog.ime.plugin.lang.ChinesePopupEditor.superClass_.handleValidChar.call(this, ch)
};
goog.ime.plugin.lang.ChinesePopupEditor.prototype.recordHistory_ = function $goog$ime$plugin$lang$ChinesePopupEditor$$recordHistory_$(oldText, newText, index) {
  this.editorChangeHistory_[index] = {oldText:oldText, newText:newText, editorText:this.getEditorText(), queryText:this.getQueryText(), index:index}
};
goog.ime.plugin.lang.ChinesePopupEditor.prototype.revertRecord_ = function $goog$ime$plugin$lang$ChinesePopupEditor$$revertRecord_$(editRecord, caretAtEnd) {
  var offset = editRecord.index;
  goog.object.remove(this.editorChangeHistory_, offset);
  var editorText = this.getEditorText(), newTextLength = editRecord.newText.length, oldTextLength = editRecord.oldText.length, newTextIndex = offset - newTextLength, currentTextAtCaret = editorText.slice(newTextIndex, offset);
  if(currentTextAtCaret == editRecord.newText) {
    var newText = editorText.slice(0, newTextIndex) + editRecord.oldText + editorText.slice(offset);
    this.setEditorText(newText);
    this.translitedPos = newTextIndex;
    return(caretAtEnd ? oldTextLength : 0) - newTextLength
  }
  return 0
};
goog.ime.plugin.lang.ChinesePopupEditor.prototype.revertHistory_ = function $goog$ime$plugin$lang$ChinesePopupEditor$$revertHistory_$(caretAtEnd) {
  var editRecord = this.editorChangeHistory_[this.cursorPos];
  if(editRecord) {
    var newOffset = this.cursorPos + this.revertRecord_(editRecord, caretAtEnd);
    this.setCaret(newOffset);
    return!0
  }
  return!1
};
goog.ime.plugin.lang.ChinesePopupEditor.prototype.handleRevertKey = function $goog$ime$plugin$lang$ChinesePopupEditor$$handleRevertKey$(e) {
  var isBackspace = e.keyCode == goog.events.KeyCodes.BACKSPACE;
  return this.editorChangeHistory_ && this.revertHistory_(isBackspace) ? !0 : goog.ime.plugin.lang.ChinesePopupEditor.superClass_.handleRevertKey.call(this, e)
};
goog.ime.plugin.lang.ChinesePopupEditor.prototype.modifyEditorText = function $goog$ime$plugin$lang$ChinesePopupEditor$$modifyEditorText$(oldText, newText) {
  var editorText = this.pluginProxy.isCaseSensitive() ? this.getEditorText() : this.getEditorText().toLowerCase();
  goog.ime.plugin.lang.ChinesePopupEditor.superClass_.modifyEditorText.call(this, oldText, newText);
  var oldIndex = editorText.indexOf(oldText);
  this.recordHistory_(oldText, newText, oldIndex + newText.length);
  this.translitedPos = oldIndex + newText.length
};
goog.ime.plugin.lang.ChinesePopupEditor.prototype.reset = function $goog$ime$plugin$lang$ChinesePopupEditor$$reset$() {
  goog.ime.plugin.lang.ChinesePopupEditor.superClass_.reset.call(this);
  this.translitedPos = 0;
  this.editorChangeHistory_ = []
};
goog.ime.plugin.lang.ChinesePopupEditor.prototype.getTransliteratableText = function $goog$ime$plugin$lang$ChinesePopupEditor$$getTransliteratableText$(text) {
  return text.length > this.translitedPos ? text.slice(this.translitedPos) : ""
};
goog.ime.plugin.lang.ChinesePopupEditor.prototype.updateEditorText = function $goog$ime$plugin$lang$ChinesePopupEditor$$updateEditorText$(sugItem) {
  var sugText = sugItem.getText(), queryText = this.getQueryText(), translitText = this.getTransliteratableText(queryText), oldText = translitText.slice(0, sugItem.getLength());
  this.modifyEditorText(oldText, sugText);
  return!this.getTransliteratableText(this.getEditorText()) ? !0 : !1
};
goog.ime.plugin.lang.VietnamesePluginProxy = function $goog$ime$plugin$lang$VietnamesePluginProxy$() {
  goog.ime.ui.PluginProxy.call(this, goog.ime.plugin.lang.VietnamesePluginProxy.defaultKeyBindings_)
};
goog.inherits(goog.ime.plugin.lang.VietnamesePluginProxy, goog.ime.ui.PluginProxy);
goog.ime.plugin.lang.VietnamesePluginProxy.defaultKeyBindings_ = {commit:[goog.events.KeyCodes.ENTER], revert:[goog.events.KeyCodes.BACKSPACE, goog.events.KeyCodes.LEFT]};
goog.ime.plugin.lang.VietnamesePluginProxy.alphaQuoteRegExp_ = /[a-zA-Z]/i;
goog.ime.plugin.lang.VietnamesePluginProxy.prototype.isValidCharKeyInternal = function $goog$ime$plugin$lang$VietnamesePluginProxy$$isValidCharKeyInternal$(editor, e, ch) {
  return this.isValidChar(ch)
};
goog.ime.plugin.lang.VietnamesePluginProxy.prototype.isCaseSensitive = function $goog$ime$plugin$lang$VietnamesePluginProxy$$isCaseSensitive$() {
  return!0
};
goog.ime.plugin.lang.VietnamesePluginProxy.prototype.isValidChar = function $goog$ime$plugin$lang$VietnamesePluginProxy$$isValidChar$(ch) {
  return goog.ime.plugin.lang.VietnamesePluginProxy.alphaQuoteRegExp_.test(ch)
};
goog.ime.plugin.lang.VietnamesePluginProxy.VowelTransformation = {a:"a\u00e0\u1ea3\u00e3\u00e1\u1ea1\u0103\u1eb1\u1eb3\u1eb5\u1eaf\u1eb7\u00e2\u1ea7\u1ea9\u1eab\u1ea5\u1ead", A:"A\u00c0\u1ea2\u00c3\u00c1\u1ea0\u0102\u1eb0\u1eb2\u1eb4\u1eae\u1eb6\u00c2\u1ea6\u1ea8\u1eaa\u1ea4\u1eac", d:"d\u0111", D:"D\u0110", e:"e\u00e8\u1ebb\u1ebd\u00e9\u1eb9\u00ea\u1ec1\u1ec3\u1ec5\u1ebf\u1ec7", E:"E\u00c8\u1eba\u1ebc\u00c9\u1eb8\u00ca\u1ec0\u1ec2\u1ec4\u1ebe\u1ec6", i:"i\u00ec\u1ec9\u0129\u00ed\u1ecb", I:"I\u00cc\u1ec8\u0128\u00cd\u1eca", 
o:"o\u00f2\u1ecf\u00f5\u00f3\u1ecd\u00f4\u1ed3\u1ed5\u1ed7\u1ed1\u1ed9\u01a1\u1edd\u1edf\u1ee1\u1edb\u1ee3", O:"O\u00d2\u1ece\u00d5\u00d3\u1ecc\u00d4\u1ed2\u1ed4\u1ed6\u1ed0\u1ed8\u01a0\u1edc\u1ede\u1ee0\u1eda\u1ee2", u:"u\u00f9\u1ee7\u0169\u00fa\u1ee5\u01b0\u1eeb\u1eed\u1eef\u1ee9\u1ef1", U:"U\u00d9\u1ee6\u0168\u00da\u1ee4\u01af\u1eea\u1eec\u1eee\u1ee8\u1ef0", y:"y\u1ef3\u1ef7\u1ef9\u00fd\u1ef5", Y:"Y\u1ef2\u1ef6\u1ef8\u00dd\u1ef4"};
goog.ime.plugin.lang.VietnamesePluginProxy.NextVowelRegex = RegExp(/\S*?([aAdDeEiIoOuUyY])/);
goog.ime.plugin.lang.VietnamesePluginProxy.prototype.findNextVowel = function $goog$ime$plugin$lang$VietnamesePluginProxy$$findNextVowel$(str) {
  var result = goog.ime.plugin.lang.VietnamesePluginProxy.NextVowelRegex.exec(str);
  if(result && 2 == result.length) {
    var hasMore = goog.ime.plugin.lang.VietnamesePluginProxy.NextVowelRegex.test(str.substring(result[0].length));
    hasMore || (result[0] = str)
  }
  return result
};
goog.ime.plugin.lang.VietnamesePluginProxy.prototype.getVariants = function $goog$ime$plugin$lang$VietnamesePluginProxy$$getVariants$(str, opt_vowel) {
  var nextVowel = opt_vowel ? opt_vowel : this.findNextVowel(str);
  if(null == nextVowel || 2 != nextVowel.length) {
    return[str]
  }
  var variants = [], vowelTransformations = goog.ime.plugin.lang.VietnamesePluginProxy.VowelTransformation[nextVowel[1]].split("");
  goog.array.forEach(vowelTransformations, function(vowelTransformation) {
    goog.array.insert(variants, nextVowel[0].replace(nextVowel[1], vowelTransformation))
  });
  return variants
};
goog.ime.plugin.lang.VietnamesePopupEditor = function $goog$ime$plugin$lang$VietnamesePopupEditor$(dom, opt_renderer) {
  goog.ime.plugin.lang.ChinesePopupEditor.call(this, dom, opt_renderer);
  this.localMode_ = !1;
  this.pluginProxy = new goog.ime.plugin.lang.VietnamesePluginProxy
};
goog.inherits(goog.ime.plugin.lang.VietnamesePopupEditor, goog.ime.plugin.lang.ChinesePopupEditor);
goog.ime.plugin.lang.VietnamesePopupEditor.CommitKeyRegex = RegExp(/[^a-zA-Z0-9]/);
goog.ime.plugin.lang.VietnamesePopupEditor.CommitKeysRegex = RegExp(/[^a-zA-Z0-9]/g);
goog.ime.plugin.lang.VietnamesePopupEditor.HistoryWordsRegex = RegExp(/([^\s\-\'\"\&;,.!?\\]*[\s\-\'\"\&;,.!?\\]*){1,4}$/);
goog.ime.plugin.lang.VietnamesePopupEditor.prototype.addLocalSuggestions = function $goog$ime$plugin$lang$VietnamesePopupEditor$$addLocalSuggestions$(suggestion) {
  var suggestionFromInputServer = [];
  goog.array.forEach(suggestion.getSuggestions(), function(item) {
    goog.array.insert(suggestionFromInputServer, item.getText())
  });
  var editorText = this.getEditorText(), variants = this.pluginProxy.getVariants(editorText);
  goog.array.forEach(variants, function(variant) {
    if(!goog.array.contains(suggestionFromInputServer, variant)) {
      var suggestionItem = new goog.ime.plugin.lang.PrefixSuggestionItem(variant, variant.length);
      suggestionItem.setType(goog.ime.plugin.lang.PrefixSuggestionItem.Type.VIETNAMESE_LOCAL);
      goog.array.insert(suggestion.getSuggestions(), suggestionItem)
    }
  })
};
goog.ime.plugin.lang.VietnamesePopupEditor.prototype.enterLocalMode = function $goog$ime$plugin$lang$VietnamesePopupEditor$$enterLocalMode$() {
  this.localMode_ = !0
};
goog.ime.plugin.lang.VietnamesePopupEditor.prototype.isLocalMode = function $goog$ime$plugin$lang$VietnamesePopupEditor$$isLocalMode$() {
  return this.localMode_
};
goog.ime.plugin.lang.VietnamesePopupEditor.prototype.lookup = function $goog$ime$plugin$lang$VietnamesePopupEditor$$lookup$(callback) {
  var suggestion = new goog.ime.plugin.lang.TranslitSuggestion(this.getEditorText(), []);
  this.addLocalSuggestions(suggestion);
  callback(!1, !0, suggestion);
  return!0
};
goog.ime.plugin.lang.VietnamesePopupEditor.prototype.isCommitKey = function $goog$ime$plugin$lang$VietnamesePopupEditor$$isCommitKey$(ch) {
  return!!ch && goog.ime.plugin.lang.VietnamesePopupEditor.CommitKeyRegex.test(ch)
};
goog.ime.plugin.lang.VietnamesePopupEditor.prototype.reset = function $goog$ime$plugin$lang$VietnamesePopupEditor$$reset$() {
  goog.ime.plugin.lang.VietnamesePopupEditor.superClass_.reset.call(this);
  this.localMode_ = !1
};
goog.ime.plugin.lang.VietnamesePopupEditor.prototype.handleKeyEventInternal = function $goog$ime$plugin$lang$VietnamesePopupEditor$$handleKeyEventInternal$(e) {
  switch(e.keyCode) {
    case goog.events.KeyCodes.UP:
      return this.showPreviousPage(), !0;
    case goog.events.KeyCodes.DOWN:
      return this.showNextPage(), !0;
    case goog.events.KeyCodes.LEFT:
      return this.highlightPrevious(), !0;
    case goog.events.KeyCodes.RIGHT:
      return this.highlightNext(), !0
  }
  var ch = 0 != e.charCode ? String.fromCharCode(e.charCode) : "";
  "9" == ch ? this.showPreviousPage() : "0" == ch && this.showNextPage();
  if(goog.string.isNumeric(ch)) {
    var childData = this.childrenData[this.currentStart + goog.string.toNumber(ch) - 1];
    childData && childData.getLength() == this.filterCommitKeys_(this.getEditorText()).length && this.appendChar(" ")
  }
  if(this.isCommitKey(ch)) {
    var highlightIndex = this.getHighlightedIndex();
    0 > highlightIndex && (highlightIndex = 0);
    childData = null;
    this.childrenData && (childData = this.childrenData[this.currentStart + highlightIndex]);
    if(childData) {
      return childData.getLength() == this.filterCommitKeys_(this.getEditorText()).length && this.appendChar(ch), this.selectSuggestion(highlightIndex)
    }
  }
  return goog.ime.plugin.lang.VietnamesePopupEditor.superClass_.handleKeyEventInternal.call(this, e)
};
goog.ime.plugin.lang.VietnamesePopupEditor.prototype.filterCommitKeys_ = function $goog$ime$plugin$lang$VietnamesePopupEditor$$filterCommitKeys_$(text) {
  return text.replace(goog.ime.plugin.lang.VietnamesePopupEditor.CommitKeysRegex, "")
};
goog.ime.plugin.lang.VietnamesePopupEditor.prototype.getTransliteratableText = function $goog$ime$plugin$lang$VietnamesePopupEditor$$getTransliteratableText$(text) {
  var transliterableText = text.length > this.translitedPos ? text.substring(this.translitedPos) : "";
  return this.filterCommitKeys_(transliterableText)
};
goog.ime.plugin.lang.VietnamesePopupEditor.prototype.getHistoryWords = function $goog$ime$plugin$lang$VietnamesePopupEditor$$getHistoryWords$(text) {
  var result = text.replace(/\n/g, "");
  return(result = goog.ime.plugin.lang.VietnamesePopupEditor.HistoryWordsRegex.exec(result)) && 0 < result.length ? result[0] : ""
};
goog.ime.plugin.lang.VietnamesePopupEditor.prototype.getQueryText = function $goog$ime$plugin$lang$VietnamesePopupEditor$$getQueryText$() {
  var queryText = goog.ime.plugin.lang.VietnamesePopupEditor.superClass_.getQueryText.call(this);
  return this.filterCommitKeys_(queryText)
};
goog.ime.plugin.lang.VietnamesePopupEditor.prototype.getDisplayContent = function $goog$ime$plugin$lang$VietnamesePopupEditor$$getDisplayContent$(childData, index) {
  var suggestionItem = childData, text = suggestionItem.getDisplayContent(index), suffix = this.getEditorText().substring(suggestionItem.getLength());
  if(suffix) {
    var container = this.getDomHelper().createDom("span", null, text), suffixText = this.getDomHelper().createDom("font", null, suffix);
    goog.style.setStyle(suffixText, "color", "#a9a9a9");
    this.getDomHelper().appendChild(container, suffixText);
    return container
  }
  return text
};
goog.ime.plugin.lang.VietnamesePopupEditor.prototype.isActionKey = function $goog$ime$plugin$lang$VietnamesePopupEditor$$isActionKey$(e) {
  var ch = 0 != e.charCode ? String.fromCharCode(e.charCode) : "";
  return this.isCommitKey(ch)
};
goog.ime.plugin.lang.VietnamesePopupEditor.prototype.updateSuggestions = function $goog$ime$plugin$lang$VietnamesePopupEditor$$updateSuggestions$(suggestion, start, num, opt_minLength) {
  var suggestionsLength = suggestion.getSuggestions().length;
  suggestionsLength - this.currentStart < opt_minLength && this.addLocalSuggestions(suggestion);
  goog.ime.plugin.lang.VietnamesePopupEditor.superClass_.updateSuggestions.call(this, suggestion, start, num)
};
goog.ime.plugin.lang.WubiPopupEditor = function $goog$ime$plugin$lang$WubiPopupEditor$(dom, opt_renderer, opt_limit_length) {
  goog.ime.plugin.lang.PopupEditor.call(this, dom, opt_renderer);
  this.limit_length_ = opt_limit_length || Number.MAX_VALUE;
  this.pluginProxy = new goog.ime.plugin.lang.ChinesePluginProxy
};
goog.inherits(goog.ime.plugin.lang.WubiPopupEditor, goog.ime.plugin.lang.PopupEditor);
goog.ime.plugin.lang.WubiPopupEditor.prototype.handleValidChar = function $goog$ime$plugin$lang$WubiPopupEditor$$handleValidChar$(e) {
  var text = this.getEditorText();
  if(this.hasFeature(goog.ime.plugin.lang.InputMethodFeatureConfig.Feature.PRECOMMIT) && text && text.length >= this.limit_length_) {
    return!0
  }
  var result = goog.ime.plugin.lang.WubiPopupEditor.superClass_.handleValidChar.call(this, e);
  if(result && this.hasFeature(goog.ime.plugin.lang.InputMethodFeatureConfig.Feature.PRECOMMIT)) {
    var queryText = this.getQueryText();
    queryText && queryText.length >= this.limit_length_ && -1 == queryText.indexOf("z") && (this.dispatchEvent(new goog.ime.plugin.TextChangedEvent), result = this.selectSuggestion(0))
  }
  return result
};
goog.ime.plugin.lang.WubiPopupEditor.prototype.setEditorText = function $goog$ime$plugin$lang$WubiPopupEditor$$setEditorText$(text) {
  var bracketPos = text.indexOf("(");
  -1 != bracketPos && (text = text.slice(0, bracketPos));
  goog.ime.plugin.lang.WubiPopupEditor.superClass_.setEditorText.call(this, text)
};
goog.ime.plugin.lang.WubiPopupEditor.prototype.selectSuggestion = function $goog$ime$plugin$lang$WubiPopupEditor$$selectSuggestion$(index) {
  var queryText = this.getQueryText(), menuItem = this.getChildAt(index);
  return queryText && (-1 == queryText.indexOf("z") || menuItem && menuItem.isEnabled()) ? goog.ime.plugin.lang.WubiPopupEditor.superClass_.selectSuggestion.call(this, index) : !0
};
goog.ime.plugin.lang.WubiPopupEditor.prototype.getDisplayContent = function $goog$ime$plugin$lang$WubiPopupEditor$$getDisplayContent$(childData, index) {
  var suggestionItem = childData, text = suggestionItem.getDisplayContent(index), annotationText = suggestionItem.getAnnotation();
  if(annotationText) {
    var container = goog.dom.createDom("span", null, text), annotation = goog.dom.createDom("font", null, annotationText);
    goog.style.setStyle(annotation, "color", "#a9a9a9");
    goog.dom.appendChild(container, annotation);
    return container
  }
  return text
};
goog.ime.plugin.lang.Zhuyin = function $goog$ime$plugin$lang$Zhuyin$() {
};
goog.ime.plugin.lang.Zhuyin.prototype.toString = function $goog$ime$plugin$lang$Zhuyin$$toString$() {
  var sb = new goog.string.StringBuffer;
  this.consonant && sb.append(this.consonant);
  this.mediumVowel && sb.append(this.mediumVowel);
  this.vowel && sb.append(this.vowel);
  this.tone && (" " != this.tone ? sb.append(this.tone) : sb.append("="));
  return sb.toString()
};
goog.ime.plugin.lang.ZhuyinConstant = {};
goog.ime.plugin.lang.ZhuyinConstant.keyToBopomofo = {a:"\u3107", b:"\u3116", c:"\u310f", d:"\u310e", e:"\u310d", f:"\u3111", g:"\u3115", h:"\u3118", i:"\u311b", j:"\u3128", k:"\u311c", l:"\u3120", m:"\u3129", n:"\u3119", o:"\u311f", p:"\u3123", q:"\u3106", r:"\u3110", s:"\u310b", t:"\u3114", u:"\u3127", v:"\u3112", w:"\u310a", x:"\u310c", y:"\u3117", z:"\u3108", 1:"\u3105", 2:"\u3109", 3:"\u02c7", 4:"\u02cb", 5:"\u3113", 6:"\u02ca", 7:"\u02d9", 8:"\u311a", 9:"\u311e", "0":"\u3122", "-":"\u3126", 
";":"\u3124", ",":"\u311d", ".":"\u3121", "/":"\u3125", " ":"\u02c9"};
goog.ime.plugin.lang.ZhuyinConstant.bopomofoToKey = {"\u3107":"a", "\u3116":"b", "\u310f":"c", "\u310e":"d", "\u310d":"e", "\u3111":"f", "\u3115":"g", "\u3118":"h", "\u311b":"i", "\u3128":"j", "\u311c":"k", "\u3120":"l", "\u3129":"m", "\u3119":"n", "\u311f":"o", "\u3123":"p", "\u3106":"q", "\u3110":"r", "\u310b":"s", "\u3114":"t", "\u3127":"u", "\u3112":"v", "\u310a":"w", "\u310c":"x", "\u3117":"y", "\u3108":"z", "\u3105":"1", "\u3109":"2", "\u02c7":"3", "\u02cb":"4", "\u3113":"5", "\u02ca":"6", 
"\u02d9":"7", "\u311a":"8", "\u311e":"9", "\u3122":"0", "\u3126":"-", "\u3124":";", "\u311d":",", "\u3121":".", "\u3125":"/", "\u02c9":" "};
goog.ime.plugin.lang.ZhuyinConstant.consonants = "1,q,a,z,2,w,s,x,e,d,c,r,f,v,5,t,g,b,y,h,n".split(",");
goog.ime.plugin.lang.ZhuyinConstant.mediumVowels = ["u", "j", "m"];
goog.ime.plugin.lang.ZhuyinConstant.vowels = "8 i k , 9 o l . 0 p ; / -".split(" ");
goog.ime.plugin.lang.ZhuyinConstant.tones = ["7", "6", "3", "4", " "];
goog.ime.plugin.lang.ZhuyinPluginProxy = function $goog$ime$plugin$lang$ZhuyinPluginProxy$() {
  goog.ime.plugin.lang.ChinesePluginProxy.call(this)
};
goog.inherits(goog.ime.plugin.lang.ZhuyinPluginProxy, goog.ime.plugin.lang.ChinesePluginProxy);
goog.ime.plugin.lang.ZhuyinPluginProxy.prototype.validCharRegExp = /[a-z0-9\-;\,\.\/]/i;
goog.ime.plugin.lang.ZhuyinPluginProxy.prototype.isValidCharKeyInternal = function $goog$ime$plugin$lang$ZhuyinPluginProxy$$isValidCharKeyInternal$(editor, e, ch) {
  return this.isValidChar(ch)
};
goog.ime.plugin.lang.ZhuyinPluginProxy.prototype.isValidChar = function $goog$ime$plugin$lang$ZhuyinPluginProxy$$isValidChar$(ch) {
  return this.validCharRegExp.test(ch)
};
goog.ime.plugin.lang.ZhuyinPluginProxy.prototype.switchInputMode = function $goog$ime$plugin$lang$ZhuyinPluginProxy$$switchInputMode$(commandType, textInput, inputTool) {
  var event;
  switch(commandType) {
    case goog.ime.plugin.CommandType.TOGGLE_LANGUAGE:
      this.isChineseMode = !this.isChineseMode;
      event = new goog.ime.api.ita.StatusBarEvent(commandType, inputTool, this.isChineseMode);
      textInput.dispatchEvent(event);
      break;
    default:
      goog.ime.plugin.lang.ZhuyinPluginProxy.superClass_.switchInputMode.call(this, commandType, textInput, inputTool)
  }
};
goog.ime.plugin.lang.ZhuyinPopupEditor = function $goog$ime$plugin$lang$ZhuyinPopupEditor$(dom, opt_renderer) {
  goog.ime.plugin.lang.PopupEditor.call(this, dom, opt_renderer);
  this.inputZhuyins_ = [];
  this.inputIndex_ = -1;
  this.mode_ = goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.START;
  this.pluginProxy = new goog.ime.plugin.lang.ZhuyinPluginProxy
};
goog.inherits(goog.ime.plugin.lang.ZhuyinPopupEditor, goog.ime.plugin.lang.PopupEditor);
goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType = {START:-1, INPUT:0, EDIT:1, PRE_SELECTED:5, SELECTED:3};
goog.ime.plugin.lang.ZhuyinPopupEditor.prototype.getQueryText = function $goog$ime$plugin$lang$ZhuyinPopupEditor$$getQueryText$() {
  var queryText = "";
  if(this.mode_ == goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.INPUT) {
    for(var i = 0;i <= this.inputIndex_;i++) {
      var zhuyin = this.inputZhuyins_[i], queryText = zhuyin.selected ? queryText + zhuyin.selected : queryText + zhuyin
    }
  }else {
    for(i = 0;i < this.inputZhuyins_.length;i++) {
      zhuyin = this.inputZhuyins_[i], i <= this.inputIndex_ ? zhuyin.selected ? queryText += zhuyin.selected : zhuyin.candidate && (queryText += zhuyin.candidate) : queryText += zhuyin
    }
  }
  return queryText
};
goog.ime.plugin.lang.ZhuyinPopupEditor.prototype.setEditorText = function $goog$ime$plugin$lang$ZhuyinPopupEditor$$setEditorText$(text) {
  goog.ime.plugin.lang.ZhuyinPopupEditor.superClass_.setEditorText.call(this, "");
  text && (goog.array.clear(this.inputZhuyins_), this.inputIndex_ = -1, this.addChar_(text.charAt(0).toLowerCase()), this.setShowText_())
};
goog.ime.plugin.lang.ZhuyinPopupEditor.prototype.reset = function $goog$ime$plugin$lang$ZhuyinPopupEditor$$reset$() {
  goog.ime.plugin.lang.ZhuyinPopupEditor.superClass_.reset.call(this);
  goog.array.clear(this.inputZhuyins_);
  this.inputIndex_ = -1;
  this.mode_ = goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.START
};
goog.ime.plugin.lang.ZhuyinPopupEditor.prototype.updateCandidate = function $goog$ime$plugin$lang$ZhuyinPopupEditor$$updateCandidate$(text, selected) {
  if(selected || this.inputZhuyins_[this.inputIndex_].tone) {
    if(selected) {
      for(var i = this.inputIndex_ + 1, j = 0;i < this.inputZhuyins_.length && j < text.length;i++, j++) {
        var zhuyin = this.inputZhuyins_[i];
        zhuyin.candidate = text.charAt(j);
        zhuyin.selected = text.charAt(j)
      }
      this.inputIndex_ += text.length;
      this.clearSuggestions()
    }else {
      i = this.inputIndex_;
      for(j = text.length - 1;0 <= i && 0 <= j;i--, j--) {
        this.inputZhuyins_[i].candidate = text.charAt(j)
      }
    }
    this.mode_ = goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.EDIT;
    this.setShowText_()
  }
};
goog.ime.plugin.lang.ZhuyinPopupEditor.prototype.handleSpecialKey = function $goog$ime$plugin$lang$ZhuyinPopupEditor$$handleSpecialKey$(e) {
  if(this.mode_ == goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.INPUT) {
    var zhuyin = this.inputZhuyins_[this.inputIndex_];
    if(e.keyCode == goog.events.KeyCodes.BACKSPACE) {
      return zhuyin.tone ? zhuyin.tone = null : zhuyin.vowel ? zhuyin.vowel = null : zhuyin.mediumVowel ? zhuyin.mediumVowel = null : zhuyin.consonant && (zhuyin.consonant = null), !zhuyin.consonant && !zhuyin.mediumVowel && !zhuyin.vowel && (goog.array.removeAt(this.inputZhuyins_, this.inputIndex_), this.inputIndex_--, this.mode_ = goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.EDIT), !0
    }
  }else {
    if(this.mode_ == goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.EDIT) {
      switch(e.keyCode) {
        case goog.events.KeyCodes.BACKSPACE:
          return goog.array.removeAt(this.inputZhuyins_, this.inputIndex_) && this.inputIndex_--, !0;
        case goog.events.KeyCodes.DELETE:
          return goog.array.removeAt(this.inputZhuyins_, this.inputIndex_ + 1), !0;
        case goog.events.KeyCodes.LEFT:
          return 0 <= this.inputIndex_ && this.inputIndex_--, !0;
        case goog.events.KeyCodes.RIGHT:
          return this.inputIndex_ < this.inputZhuyins_.length - 1 && this.inputIndex_++, !0;
        case goog.events.KeyCodes.HOME:
          return this.inputIndex_ = -1, !0;
        case goog.events.KeyCodes.END:
          return this.inputIndex_ = this.inputZhuyins_.length - 1, !0;
        case goog.events.KeyCodes.SPACE:
        ;
        case goog.events.KeyCodes.UP:
        ;
        case goog.events.KeyCodes.DOWN:
          return this.inputIndex_ == this.inputZhuyins_.length - 1 && this.inputIndex_--, this.mode_ = goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.PRE_SELECTED, !0
      }
    }else {
      if(this.mode_ == goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.SELECTED) {
        switch(e.keyCode) {
          case goog.events.KeyCodes.ENTER:
            return this.selectSuggestion(this.getHighlightedIndex()), !1;
          case goog.events.KeyCodes.UP:
          ;
          case goog.events.KeyCodes.PAGE_UP:
            return this.showPreviousPage(), !0;
          case goog.events.KeyCodes.DOWN:
          ;
          case goog.events.KeyCodes.SPACE:
          ;
          case goog.events.KeyCodes.PAGE_DOWN:
            return this.showNextPage(), !0;
          case goog.events.KeyCodes.LEFT:
            return this.highlightPrevious(), !0;
          case goog.events.KeyCodes.RIGHT:
            return this.highlightNext(), !0;
          case goog.events.KeyCodes.ESC:
            return this.clearSuggestions(), this.mode_ = goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.EDIT, !0
        }
        var ch = String.fromCharCode(e.charCode);
        if(goog.string.isNumeric(ch)) {
          var num = goog.string.toNumber(ch);
          if(0 < num && num <= this.getChildCount()) {
            return this.selectSuggestion(num - 1) && (this.mode_ = goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.EDIT), !0
          }
        }
      }
    }
  }
  return!1
};
goog.ime.plugin.lang.ZhuyinPopupEditor.prototype.handleKeyEventInternal = function $goog$ime$plugin$lang$ZhuyinPopupEditor$$handleKeyEventInternal$(e) {
  var m = "handleKeyEventInternal called:";
  if(!this.pluginProxy) {
    return!1
  }
  if(this.pluginProxy.isHideKey(this, e) && this.mode_ != goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.SELECTED) {
    return this.logger.info(m + "Hide key pressed"), this.commitEditorText(!1)
  }
  if(this.handleSpecialKey(e)) {
    return this.setShowText_(), !0
  }
  if(this.pluginProxy.isCommitKey(this, e)) {
    return this.logger.info(m + "Committing text on commit key."), this.commitEditorText(!0)
  }
  var ch = String.fromCharCode(e.charCode).toLowerCase();
  if((" " == ch || this.pluginProxy.isValidCharKey(this, e)) && (this.mode_ == goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.START || this.mode_ == goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.INPUT || this.mode_ == goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.EDIT)) {
    if(this.mode_ == goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.EDIT) {
      if(goog.array.contains(goog.ime.plugin.lang.ZhuyinConstant.tones, ch)) {
        return!0
      }
      var zhuyin = new goog.ime.plugin.lang.Zhuyin;
      this.inputIndex_++;
      goog.array.insertAt(this.inputZhuyins_, zhuyin, this.inputIndex_)
    }
    this.addChar_(ch);
    this.mode_ = goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.INPUT;
    this.setShowText_();
    return!0
  }
  var ret = goog.ime.ui.CustomPopupMenu.superClass_.handleKeyEventInternal.call(this, e);
  return!ret && goog.ime.plugin.EventUtil.isModifierEvent(e) || e.keyCode >= goog.events.KeyCodes.F1 && e.keyCode <= goog.events.KeyCodes.F12 ? !1 : !0
};
goog.ime.plugin.lang.ZhuyinPopupEditor.prototype.addChar_ = function $goog$ime$plugin$lang$ZhuyinPopupEditor$$addChar_$(ch) {
  var zhuyin;
  0 <= this.inputIndex_ ? zhuyin = this.inputZhuyins_[this.inputIndex_] : (zhuyin = new goog.ime.plugin.lang.Zhuyin, goog.array.insert(this.inputZhuyins_, zhuyin), this.inputIndex_ = 0, this.mode_ = goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.INPUT);
  zhuyin.candidate && (zhuyin = new goog.ime.plugin.lang.Zhuyin, this.mode_ = 0, goog.array.insert(this.inputZhuyins_, zhuyin), this.inputIndex_++);
  goog.array.contains(goog.ime.plugin.lang.ZhuyinConstant.consonants, ch) ? zhuyin.consonant = ch : goog.array.contains(goog.ime.plugin.lang.ZhuyinConstant.mediumVowels, ch) ? zhuyin.mediumVowel = ch : goog.array.contains(goog.ime.plugin.lang.ZhuyinConstant.vowels, ch) ? zhuyin.vowel = ch : goog.array.contains(goog.ime.plugin.lang.ZhuyinConstant.tones, ch) && (zhuyin.tone = ch)
};
goog.ime.plugin.lang.ZhuyinPopupEditor.prototype.appendZhuyinChar_ = function $goog$ime$plugin$lang$ZhuyinPopupEditor$$appendZhuyinChar_$(ch, isUnderLine, opt_pos) {
  goog.isNumber(opt_pos) && this.setCaret(opt_pos);
  var innerHTML = this.leftTextSpan.innerHTML, innerHTML = isUnderLine ? innerHTML + ("<u>" + ch + "</u>") : innerHTML + ch;
  this.leftTextSpan.innerHTML = innerHTML;
  this.cursorPos++
};
goog.ime.plugin.lang.ZhuyinPopupEditor.prototype.getMode = function $goog$ime$plugin$lang$ZhuyinPopupEditor$$getMode$() {
  return this.mode_
};
goog.ime.plugin.lang.ZhuyinPopupEditor.prototype.setMode = function $goog$ime$plugin$lang$ZhuyinPopupEditor$$setMode$(mode) {
  this.mode_ = mode
};
goog.ime.plugin.lang.ZhuyinPopupEditor.prototype.setShowText_ = function $goog$ime$plugin$lang$ZhuyinPopupEditor$$setShowText_$() {
  this.setEditorText("");
  var cursorPos = 0;
  goog.array.forEach(this.inputZhuyins_, function(zhuyin, i) {
    zhuyin.selected ? this.appendZhuyinChar_(zhuyin.selected, !1) : zhuyin.candidate ? this.appendZhuyinChar_(zhuyin.candidate, !0) : (zhuyin.consonant && this.appendZhuyinChar_(goog.ime.plugin.lang.ZhuyinConstant.keyToBopomofo[zhuyin.consonant], !0), zhuyin.mediumVowel && this.appendZhuyinChar_(goog.ime.plugin.lang.ZhuyinConstant.keyToBopomofo[zhuyin.mediumVowel], !0), zhuyin.vowel && this.appendZhuyinChar_(goog.ime.plugin.lang.ZhuyinConstant.keyToBopomofo[zhuyin.vowel], !0), zhuyin.tone && this.appendZhuyinChar_(goog.ime.plugin.lang.ZhuyinConstant.keyToBopomofo[zhuyin.tone], 
    !0));
    i == this.inputIndex_ && (cursorPos = this.cursorPos)
  }, this);
  this.setCaret(cursorPos)
};
goog.ime.plugin.lang.ZhuyinPopupEditor.prototype.isFinished = function $goog$ime$plugin$lang$ZhuyinPopupEditor$$isFinished$() {
  return this.mode_ == goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.PRE_SELECTED ? !0 : 0 > this.inputIndex_ ? !1 : !!this.inputZhuyins_[this.inputIndex_].tone && this.mode_ == goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.INPUT
};
goog.ime.plugin.lang.ZhuyinPopupEditor.prototype.getTransliteratableText = function $goog$ime$plugin$lang$ZhuyinPopupEditor$$getTransliteratableText$(text) {
  return/[a-z0-9\-;\,\.\/]/i.test(text) ? text : ""
};
goog.ime.plugin.lang.ZhuyinPopupEditor.prototype.updateSuggestions = function $goog$ime$plugin$lang$ZhuyinPopupEditor$$updateSuggestions$(suggestion, start, num) {
  this.setPageSize(num);
  this.getMode() == goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.INPUT ? this.updateCandidate(suggestion.getSuggestions()[0].getText(), !1) : (this.setChildrenData(suggestion.getSuggestions()), this.reshowSuggestions(start), this.setMode(goog.ime.plugin.lang.ZhuyinPopupEditor.ModeType.SELECTED))
};
goog.ime.plugin.lang.ZhuyinPopupEditor.prototype.updateEditorText = function $goog$ime$plugin$lang$ZhuyinPopupEditor$$updateEditorText$(sugItem) {
  var sugText = sugItem.getText();
  this.updateCandidate(sugText, !0);
  return!1
};
goog.ime.ui.CustomRenderer = {};
goog.ime.ui.CustomRenderer.getContainerRenderer = function $goog$ime$ui$CustomRenderer$getContainerRenderer$(ctor, opt_cssClassName, opt_additionalCssClasses) {
  var renderer = opt_cssClassName ? goog.ui.ContainerRenderer.getCustomRenderer(ctor, opt_cssClassName) : goog.isFunction(ctor.getInstance) ? ctor.getInstance() : new ctor;
  goog.ime.ui.extendCssClasses(renderer, opt_additionalCssClasses);
  return renderer
};
goog.ime.ui.CustomRenderer.getControlRenderer = function $goog$ime$ui$CustomRenderer$getControlRenderer$(ctor, opt_cssClassName, opt_additionalCssClasses) {
  var renderer = opt_cssClassName ? goog.ui.ControlRenderer.getCustomRenderer(ctor, opt_cssClassName) : goog.isFunction(ctor.getInstance) ? ctor.getInstance() : new ctor;
  goog.ime.ui.extendCssClasses(renderer, opt_additionalCssClasses);
  return renderer
};
goog.ime.ui.extendCssClasses = function $goog$ime$ui$extendCssClasses$(renderer, opt_additionalCssClasses) {
  if(goog.isArray(opt_additionalCssClasses) && 0 < opt_additionalCssClasses.length) {
    var origGetClassFn = renderer.getClassNames;
    renderer.getClassNames = function $renderer$getClassNames$(control) {
      var classNames = origGetClassFn.call(this, control);
      goog.array.extend(classNames, opt_additionalCssClasses);
      goog.array.find(classNames, function(cn) {
        return 0 <= cn.indexOf("ita-transliterate-indic-button")
      }) && alert("css:" + classNames.join(" "));
      return classNames
    }
  }
};
goog.positioning.AbsolutePosition = function $goog$positioning$AbsolutePosition$(arg1, opt_arg2) {
  this.coordinate = arg1 instanceof goog.math.Coordinate ? arg1 : new goog.math.Coordinate(arg1, opt_arg2)
};
goog.inherits(goog.positioning.AbsolutePosition, goog.positioning.AbstractPosition);
goog.positioning.AbsolutePosition.prototype.reposition = function $goog$positioning$AbsolutePosition$$reposition$(movableElement, movableCorner, opt_margin, opt_preferredSize) {
  goog.positioning.positionAtCoordinate(this.coordinate, movableElement, movableCorner, opt_margin, null, null, opt_preferredSize)
};
goog.ime.plugin.lang.InstancePopupEditor = function $goog$ime$plugin$lang$InstancePopupEditor$(dom, opt_renderer) {
  goog.ime.plugin.lang.PopupEditor.call(this, dom, opt_renderer);
  this.originalText_ = ""
};
goog.inherits(goog.ime.plugin.lang.InstancePopupEditor, goog.ime.plugin.lang.PopupEditor);
goog.ime.plugin.lang.InstancePopupEditor.prototype.logger = goog.debug.Logger.getLogger("goog.ime.plugin.lang.InstancePopupEditor");
goog.ime.plugin.lang.InstancePopupEditor.prototype.getAutoSelectionText = function $goog$ime$plugin$lang$InstancePopupEditor$$getAutoSelectionText$() {
  var index = this.getHighlightedIndex();
  if(0 <= index) {
    var sugMenuItem = this.getChildAt(index), sugText = sugMenuItem.getValue().getText();
    return sugText
  }
  return goog.dom.getTextContent(this.textEditorElement) || ""
};
goog.ime.plugin.lang.InstancePopupEditor.prototype.displayCandidates = function $goog$ime$plugin$lang$InstancePopupEditor$$displayCandidates$() {
  goog.ime.plugin.lang.InstancePopupEditor.superClass_.displayCandidates.call(this);
  this.setTranslatedEditorText_()
};
goog.ime.plugin.lang.InstancePopupEditor.prototype.commitEditorText = function $goog$ime$plugin$lang$InstancePopupEditor$$commitEditorText$(success) {
  goog.ime.plugin.lang.InstancePopupEditor.superClass_.commitEditorText.call(this, success);
  this.clearEditorText();
  return!0
};
goog.ime.plugin.lang.InstancePopupEditor.prototype.highlightNext = function $goog$ime$plugin$lang$InstancePopupEditor$$highlightNext$() {
  goog.ime.plugin.lang.InstancePopupEditor.superClass_.highlightNext.call(this);
  this.setTranslatedEditorText_()
};
goog.ime.plugin.lang.InstancePopupEditor.prototype.highlightPrevious = function $goog$ime$plugin$lang$InstancePopupEditor$$highlightPrevious$() {
  goog.ime.plugin.lang.InstancePopupEditor.superClass_.highlightPrevious.call(this);
  this.setTranslatedEditorText_()
};
goog.ime.plugin.lang.InstancePopupEditor.prototype.highlightFirst = function $goog$ime$plugin$lang$InstancePopupEditor$$highlightFirst$() {
  goog.ime.plugin.lang.InstancePopupEditor.superClass_.highlightFirst.call(this);
  this.setTranslatedEditorText_()
};
goog.ime.plugin.lang.InstancePopupEditor.prototype.highlightLast = function $goog$ime$plugin$lang$InstancePopupEditor$$highlightLast$() {
  goog.ime.plugin.lang.InstancePopupEditor.superClass_.highlightLast.call(this);
  this.setTranslatedEditorText_()
};
goog.ime.plugin.lang.InstancePopupEditor.prototype.setTranslatedEditorText_ = function $goog$ime$plugin$lang$InstancePopupEditor$$setTranslatedEditorText_$() {
  var index = this.getHighlightedIndex(), index = 0 > index ? 0 : index, sugMenuItem = this.getChildAt(index), text = sugMenuItem.getValue().getText();
  goog.dom.setTextContent(this.leftTextSpan, text);
  goog.dom.setTextContent(this.rightTextSpan, "")
};
goog.ime.plugin.lang.InstancePopupEditor.prototype.setEditorText = function $goog$ime$plugin$lang$InstancePopupEditor$$setEditorText$(text) {
  this.originalText_ = text;
  this.cursorPos = text.length
};
goog.ime.plugin.lang.InstancePopupEditor.prototype.getEditorText = function $goog$ime$plugin$lang$InstancePopupEditor$$getEditorText$() {
  return this.originalText_
};
goog.ime.plugin.lang.InstancePopupEditor.prototype.handleValidChar = function $goog$ime$plugin$lang$InstancePopupEditor$$handleValidChar$(ch) {
  this.originalText_ += ch;
  this.cursorPos++;
  return!0
};
goog.ime.plugin.lang.InstancePopupEditor.prototype.handleRevertKey = function $goog$ime$plugin$lang$InstancePopupEditor$$handleRevertKey$(e) {
  var isBackspace = e.keyCode == goog.events.KeyCodes.BACKSPACE;
  return isBackspace && 0 < this.cursorPos ? (this.originalText_ = this.originalText_.slice(0, -1), this.cursorPos--, !0) : !1
};
goog.ime.plugin.lang.PopupEditorRenderer = function $goog$ime$plugin$lang$PopupEditorRenderer$(popupEditorRenderer, suggestionRenderer, multiSegmentPopupEditorRenderer, multiSegmentSuggestionRenderer) {
  this.popupEditorRenderer = popupEditorRenderer;
  this.suggestionRenderer = suggestionRenderer;
  this.multiSegmentPopupEditorRenderer = multiSegmentPopupEditorRenderer;
  this.multiSegmentSuggestionRenderer = multiSegmentSuggestionRenderer;
  this.popupEditors_ = {}
};
goog.inherits(goog.ime.plugin.lang.PopupEditorRenderer, goog.Disposable);
goog.ime.plugin.lang.PopupEditorRenderer.prototype.logger = goog.debug.Logger.getLogger("goog.ime.plugin.lang.PopupEditorRenderer");
goog.ime.plugin.lang.PopupEditorRenderer.POPUP_EDITOR_CSS_CLASS = "ita-popupeditor";
goog.ime.plugin.lang.PopupEditorRenderer.POPUP_EDITOR_MENUITEM_CSS_CLASS = "ita-popupeditor-menuitem";
goog.ime.plugin.lang.PopupEditorRenderer.MUL_SEG_POPUP_EDITOR_CSS_CLASS = "ita-multisegmentpopupeditor";
goog.ime.plugin.lang.PopupEditorRenderer.MUL_SEG_POPUP_EDITOR_MENUITEM_CSS_CLASS = "ita-multisegmentpopupeditor-menuitem";
goog.ime.plugin.lang.PopupEditorRenderer.getDefault = function $goog$ime$plugin$lang$PopupEditorRenderer$getDefault$() {
  var additionalCss = [];
  goog.userAgent.IE && goog.array.insert(additionalCss, "ie");
  var popupEditorRenderer = goog.ime.ui.CustomRenderer.getContainerRenderer(goog.ui.MenuRenderer, goog.ime.plugin.lang.PopupEditorRenderer.POPUP_EDITOR_CSS_CLASS, additionalCss), suggestionRenderer = goog.ime.ui.CustomRenderer.getControlRenderer(goog.ui.MenuItemRenderer, goog.ime.plugin.lang.PopupEditorRenderer.POPUP_EDITOR_MENUITEM_CSS_CLASS), multiSegmentPopupEditorRenderer = goog.ime.ui.CustomRenderer.getContainerRenderer(goog.ui.MenuRenderer, goog.ime.plugin.lang.PopupEditorRenderer.MUL_SEG_POPUP_EDITOR_CSS_CLASS, 
  additionalCss), multiSegmentSuggestionRenderer = goog.ime.ui.CustomRenderer.getControlRenderer(goog.ui.MenuItemRenderer, goog.ime.plugin.lang.PopupEditorRenderer.MUL_SEG_POPUP_EDITOR_MENUITEM_CSS_CLASS);
  return new goog.ime.plugin.lang.PopupEditorRenderer(popupEditorRenderer, suggestionRenderer, multiSegmentPopupEditorRenderer, multiSegmentSuggestionRenderer)
};
goog.ime.plugin.lang.PopupEditorRenderer.prototype.getEditor = function $goog$ime$plugin$lang$PopupEditorRenderer$$getEditor$(inputTool) {
  if(!inputTool) {
    return null
  }
  var popupEditor = this.popupEditors_[inputTool.code];
  if(!popupEditor) {
    var domHelper = goog.ime.api.ita.DocumentReplacer.getDomHelper();
    switch(inputTool.code) {
      case goog.ime.lang.InputToolCode.INPUTMETHOD_ZHUYIN_CHINESE_TRADITIONAL:
        popupEditor = new goog.ime.plugin.lang.ZhuyinPopupEditor(domHelper, this.popupEditorRenderer);
        break;
      case goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_VIETNAMESE:
        popupEditor = new goog.ime.plugin.lang.VietnamesePopupEditor(domHelper, this.popupEditorRenderer);
        break;
      case goog.ime.lang.InputToolCode.INPUTMETHOD_PINYIN_CHINESE_SIMPLIFIED:
      ;
      case goog.ime.lang.InputToolCode.INPUTMETHOD_PINYIN_CHINESE_TRADITIONAL:
        popupEditor = new goog.ime.plugin.lang.ChinesePopupEditor(domHelper, this.popupEditorRenderer);
        break;
      case goog.ime.lang.InputToolCode.INPUTMETHOD_WUBI_CHINESE_SIMPLIFIED:
        popupEditor = new goog.ime.plugin.lang.WubiPopupEditor(domHelper, this.popupEditorRenderer, 4);
        break;
      case goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_JAPANESE:
      ;
      case goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HIRAGANA:
        popupEditor = new goog.ime.plugin.lang.MultiSegmentPopupEditor(domHelper, this.multiSegmentPopupEditorRenderer);
        break;
      default:
        var config = goog.ime.plugin.lang.InputMethodFeatureConfig;
        if(goog.array.contains(config.getInputMethodsWithPopupEditor(), inputTool.code)) {
          var instancefeatureMap = config.inputMethodFeatures[config.Feature.INSTANCE_DISPLAY], popupEditor = goog.array.contains(instancefeatureMap, inputTool.code) ? new goog.ime.plugin.lang.InstancePopupEditor(domHelper, this.popupEditorRenderer) : new goog.ime.plugin.lang.PopupEditor(domHelper, this.popupEditorRenderer)
        }else {
          return this.logger.warning("No popupeditor is available for :" + inputTool.code), null
        }
    }
    popupEditor.setInputTool && popupEditor.setInputTool(inputTool);
    popupEditor.setMenuItemRenderer(this.getSuggestionRenderer_(inputTool));
    popupEditor.render();
    popupEditor.reset();
    this.popupEditors_[inputTool.code] = popupEditor
  }
  return popupEditor
};
goog.ime.plugin.lang.PopupEditorRenderer.prototype.render = function $goog$ime$plugin$lang$PopupEditorRenderer$$render$(editor, position, opt_text) {
  this.logger.info("render:text:<" + opt_text + ">");
  editor.reset();
  editor.showWithPosition(position, void 0, new goog.math.Box(2, 0, 0, 0));
  opt_text && editor.setEditorText(opt_text)
};
goog.ime.plugin.lang.PopupEditorRenderer.prototype.fitToViewPort_ = function $goog$ime$plugin$lang$PopupEditorRenderer$$fitToViewPort_$(editor) {
  var popupRect = goog.style.getBounds(editor.getElement()), viewportSize = goog.dom.getDomHelper(editor.getElement()).getViewportSize(), margin = viewportSize.width - popupRect.left - popupRect.width;
  if(0 > margin) {
    var left = viewportSize.width - popupRect.width, position = new goog.positioning.AbsolutePosition(new goog.math.Coordinate(0 < left ? left : 0, popupRect.top));
    editor.showWithPosition(position, goog.positioning.Corner.TOP_LEFT, new goog.math.Box(2, 0, 0, 0))
  }
  0 > popupRect.left && (position = new goog.positioning.AbsolutePosition(new goog.math.Coordinate(0, popupRect.top)), editor.showWithPosition(position, goog.positioning.Corner.TOP_LEFT, new goog.math.Box(2, 0, 0, 0)))
};
goog.ime.plugin.lang.PopupEditorRenderer.prototype.renderSuggestion = function $goog$ime$plugin$lang$PopupEditorRenderer$$renderSuggestion$(editor, suggestion, num, opt_start, opt_requeriedSugCount) {
  var start = opt_start || 0;
  editor.updateSuggestions(suggestion, start, num, opt_requeriedSugCount);
  this.fitToViewPort_(editor)
};
goog.ime.plugin.lang.PopupEditorRenderer.prototype.disposeInternal = function $goog$ime$plugin$lang$PopupEditorRenderer$$disposeInternal$() {
  goog.object.forEach(this.popupEditors_, function(editor) {
    editor.dispose()
  });
  this.popupEditors_ = {};
  goog.ime.plugin.lang.PopupEditorRenderer.superClass_.disposeInternal.call(this)
};
goog.ime.plugin.lang.PopupEditorRenderer.prototype.getSuggestionRenderer_ = function $goog$ime$plugin$lang$PopupEditorRenderer$$getSuggestionRenderer_$(inputTool) {
  return inputTool.code == goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_JAPANESE || inputTool.code == goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HIRAGANA ? this.multiSegmentSuggestionRenderer : this.suggestionRenderer
};
goog.ime.plugin.lang.PopupEditorRenderer.prototype.showPopupEditor = function $goog$ime$plugin$lang$PopupEditorRenderer$$showPopupEditor$(editor, position, e) {
  if(editor instanceof goog.ime.plugin.lang.MultiSegmentPopupEditor) {
    this.render(editor, position), editor.getPluginProxy().handleValidCharKey(editor, e)
  }else {
    var ch = String.fromCharCode(e.charCode);
    this.render(editor, position, ch)
  }
};
goog.ime.plugin.lang.PopupEditorRenderer.prototype.showPopupEditorByRange = function $goog$ime$plugin$lang$PopupEditorRenderer$$showPopupEditorByRange$(editor, range, container, e) {
  var domHelper = goog.dom.getDomHelper(container), spanNode = domHelper.createElement(goog.dom.TagName.SPAN);
  spanNode.appendChild(domHelper.createTextNode("\u200b"));
  if(!goog.userAgent.IE || 9 <= goog.userAgent.VERSION) {
    range.insertNode(spanNode, !1)
  }else {
    var orignalText = null;
    range.isCollapsed() || (orignalText = range.getText(), range.collapse(!1));
    spanNode = range.replaceContentsWithNode(spanNode);
    orignalText && (range.collapse(!0), range.getBrowserRangeObject().moveStart("character", 0 - orignalText.length), range.select())
  }
  var position = new goog.positioning.MenuAnchoredPosition(spanNode, goog.positioning.Corner.BOTTOM_START, !0, !1);
  this.showPopupEditor(editor, position, e);
  domHelper.removeNode(spanNode)
};
goog.ime.ui.SuggestionMenuRenderer = function $goog$ime$ui$SuggestionMenuRenderer$() {
};
goog.ime.plugin.lang.SuggestionMenuRenderer = function $goog$ime$plugin$lang$SuggestionMenuRenderer$(menuRenderer, menuItemRenderer) {
  this.menuRenderer = menuRenderer;
  this.menuItemRenderer = menuItemRenderer;
  this.sugMenu_ = null
};
goog.ime.plugin.lang.SuggestionMenuRenderer.MENU_RESOURCEID = goog.ime.dom.TextInput.generateResourceId("suggestionmenu");
goog.ime.plugin.lang.SuggestionMenuRenderer.MENU_CSS_CLASS = "ita-transliterate-indic-suggestion-menu";
goog.ime.plugin.lang.SuggestionMenuRenderer.MENUITEM_CSS_CLASS = "ita-transliterate-indic-suggestion-menuitem";
goog.ime.plugin.lang.SuggestionMenuRenderer.getDefault = function $goog$ime$plugin$lang$SuggestionMenuRenderer$getDefault$() {
  var additionalCss = [];
  goog.userAgent.IE && goog.array.insert(additionalCss, "ie");
  var menuRenderer = goog.ime.ui.CustomRenderer.getContainerRenderer(goog.ui.MenuRenderer, goog.ime.plugin.lang.SuggestionMenuRenderer.MENU_CSS_CLASS, additionalCss), menuItemRenderer = goog.ime.ui.CustomRenderer.getControlRenderer(goog.ui.MenuItemRenderer, goog.ime.plugin.lang.SuggestionMenuRenderer.MENUITEM_CSS_CLASS);
  return new goog.ime.plugin.lang.SuggestionMenuRenderer(menuRenderer, menuItemRenderer)
};
goog.ime.plugin.lang.SuggestionMenuRenderer.prototype.getMenu = function $goog$ime$plugin$lang$SuggestionMenuRenderer$$getMenu$() {
  this.sugMenu_ || (this.sugMenu_ = new goog.ime.ui.CustomPopupMenu(goog.ime.api.ita.DocumentReplacer.getDomHelper(), this.menuRenderer), this.sugMenu_.setMenuItemRenderer(this.menuItemRenderer), this.sugMenu_.render());
  return this.sugMenu_
};
goog.ime.plugin.lang.SuggestionMenuRenderer.prototype.render = function $goog$ime$plugin$lang$SuggestionMenuRenderer$$render$(control, position, suggestion, callback, opt_style) {
  var sugMenu = this.getMenu(control);
  sugMenu.setCallback(callback);
  sugMenu.removeChildren(!0);
  opt_style && goog.style.setStyle(sugMenu.getElement(), opt_style);
  suggestion.forEachSuggestion(function(sugText) {
    sugMenu.addMenuItem(sugText, sugText)
  });
  var sugInput = suggestion.getInput();
  sugMenu.addMenuItem(sugInput, sugInput, void 0, {direction:"ltr"});
  goog.userAgent.IE && goog.userAgent.isVersion(7) && !goog.userAgent.isVersion(8) && goog.style.setStyle(sugMenu.getElement(), {width:"300px"});
  sugMenu.showWithPosition(position);
  sugMenu.highlightFirst()
};
goog.structs.Queue = function $goog$structs$Queue$() {
  this.elements_ = []
};
goog.structs.Queue.prototype.head_ = 0;
goog.structs.Queue.prototype.tail_ = 0;
goog.structs.Queue.prototype.enqueue = function $goog$structs$Queue$$enqueue$(element) {
  this.elements_[this.tail_++] = element
};
goog.structs.Queue.prototype.dequeue = function $goog$structs$Queue$$dequeue$() {
  if(this.head_ != this.tail_) {
    var result = this.elements_[this.head_];
    delete this.elements_[this.head_];
    this.head_++;
    return result
  }
};
goog.structs.Queue.prototype.peek = function $goog$structs$Queue$$peek$() {
  return this.head_ == this.tail_ ? void 0 : this.elements_[this.head_]
};
goog.structs.Queue.prototype.getCount = function $goog$structs$Queue$$getCount$() {
  return this.tail_ - this.head_
};
goog.structs.Queue.prototype.isEmpty = function $goog$structs$Queue$$isEmpty$() {
  return 0 == this.tail_ - this.head_
};
goog.structs.Queue.prototype.clear = function $goog$structs$Queue$$clear$() {
  this.tail_ = this.head_ = this.elements_.length = 0
};
goog.structs.Queue.prototype.contains = function $goog$structs$Queue$$contains$(obj) {
  return goog.array.contains(this.elements_, obj)
};
goog.structs.Queue.prototype.remove = function $goog$structs$Queue$$remove$(obj) {
  var index = goog.array.indexOf(this.elements_, obj);
  if(0 > index) {
    return!1
  }
  index == this.head_ ? this.dequeue() : (goog.array.removeAt(this.elements_, index), this.tail_--);
  return!0
};
goog.structs.Queue.prototype.getValues = function $goog$structs$Queue$$getValues$() {
  return this.elements_.slice(this.head_, this.tail_)
};
goog.ime.datasource = {};
goog.ime.datasource.DataSource = function $goog$ime$datasource$DataSource$() {
};
goog.ime.datasource.RemoteDataRequest = function $goog$ime$datasource$RemoteDataRequest$(query, callback) {
  this.query = query;
  this.callback = callback
};
goog.ime.datasource.RemoteDataSource = function $goog$ime$datasource$RemoteDataSource$() {
  goog.Disposable.call(this);
  this.preferLatest = !1;
  this.responseCache = {};
  this.reverseCache = {};
  this.requestQueue = new goog.structs.Queue
};
goog.inherits(goog.ime.datasource.RemoteDataSource, goog.Disposable);
goog.ime.datasource.RemoteDataSource.prototype.logger = goog.debug.Logger.getLogger("goog.ime.datasource.RemoteDataSource");
goog.ime.datasource.RemoteDataSource.prototype.findCacheLeaf = function $goog$ime$datasource$RemoteDataSource$$findCacheLeaf$(cache, hashKey) {
  var cacheLeaf = goog.array.reduce(hashKey, function(cacheNode, hashKeyElem) {
    return cacheNode[hashKeyElem] || (cacheNode[hashKeyElem] = {})
  }, cache);
  return cacheLeaf
};
goog.ime.datasource.RemoteDataSource.prototype.lookupCache = function $goog$ime$datasource$RemoteDataSource$$lookupCache$(query, opt_cache) {
  var queryHash = query.hashKey(), queryText = query.getText();
  if(query.isReverse) {
    var reverseCache = this.findCacheLeaf(this.reverseCache, queryHash), queryText = reverseCache[queryText]
  }
  var cache = this.findCacheLeaf(opt_cache || this.responseCache, queryHash);
  return cache[queryText]
};
goog.ime.datasource.RemoteDataSource.prototype.lookupCallbackInternal = goog.nullFunction;
goog.ime.datasource.RemoteDataSource.prototype.lookupCallback = function $goog$ime$datasource$RemoteDataSource$$lookupCallback$(request, success, response) {
  this.requestInProgress = null;
  response && this.lookupCallbackInternal(request, success, response);
  this.processQueue()
};
goog.ime.datasource.RemoteDataSource.prototype.sendRequest = goog.nullFunction;
goog.ime.datasource.RemoteDataSource.prototype.abortRequest = goog.nullFunction;
goog.ime.datasource.RemoteDataSource.prototype.processQueue = function $goog$ime$datasource$RemoteDataSource$$processQueue$() {
  var m = "processQueue:";
  this.logger.info(m + "queueEmpty?:" + !this.requestQueue.isEmpty());
  var request;
  if(!this.requestQueue.isEmpty()) {
    if(this.requestInProgress) {
      var pendingQuery = this.requestInProgress.query;
      request = this.requestQueue.peek();
      var newQuery = request.query;
      if(pendingQuery.satisfies(newQuery)) {
        this.logger.info(m + "Pending satisfies new:" + newQuery.text);
        this.requestQueue.dequeue();
        return
      }
      this.preferLatest && (this.logger.info(m + "Abort"), this.abortRequest(this.requestInProgress), this.requestInProgress = null)
    }
    if(!this.requestInProgress && (request = this.requestQueue.dequeue())) {
      this.requestInProgress = request, this.sendRequest(request, goog.bind(this.lookupCallback, this, request)), this.logger.info(m + "Sent request:" + request.query.text)
    }
  }
};
goog.ime.datasource.RemoteDataSource.prototype.lookup = function $goog$ime$datasource$RemoteDataSource$$lookup$(query, callback) {
  var lookupResponse = this.lookupCache(query);
  if(lookupResponse) {
    return callback(query, !0, !0, lookupResponse), !0
  }
  var lastRequest = this.requestQueue.peek();
  (!lastRequest || !lastRequest.query.merge(query)) && this.requestQueue.enqueue(new goog.ime.datasource.RemoteDataRequest(query, callback));
  this.processQueue();
  return!1
};
goog.ime.plugin.lang.TranslitDataSource = function $goog$ime$plugin$lang$TranslitDataSource$(asyncHttpService, dataSourceConfigMap, opt_preferLatest, opt_sugItemBuilder) {
  goog.ime.datasource.RemoteDataSource.call(this);
  this.preferLatest = !!opt_preferLatest;
  this.asyncHttpService = asyncHttpService;
  this.dataSourceConfigMap = dataSourceConfigMap;
  this.userVotes_ = {};
  this.lastQueryInfoMap_ = {};
  this.buildSuggestionItem_ = opt_sugItemBuilder || goog.functions.identity;
  this.createCsiTimer_()
};
goog.inherits(goog.ime.plugin.lang.TranslitDataSource, goog.ime.datasource.RemoteDataSource);
goog.ime.plugin.lang.TranslitDataSource.prototype.getDataSourceConfig = function $goog$ime$plugin$lang$TranslitDataSource$$getDataSourceConfig$(query) {
  var config = this.dataSourceConfigMap[""];
  query && query.targetLangCode && this.dataSourceConfigMap[query.targetLangCode] && (config = this.dataSourceConfigMap[query.targetLangCode]);
  return config
};
goog.ime.plugin.lang.TranslitDataSource.ENABLE_CSI = !0;
goog.ime.plugin.lang.TranslitDataSource.TimerName = "ti_all,ti_";
goog.ime.plugin.lang.TranslitDataSource.TickLabel = {REQUEST_SENT:"_rs", RESPONSE_BACK:"rtt"};
goog.ime.plugin.lang.TranslitDataSource.prototype.timer_ = null;
goog.ime.plugin.lang.TranslitDataSource.prototype.logger = goog.debug.Logger.getLogger("goog.ime.plugin.lang.TranslitDataSource");
goog.ime.plugin.lang.TranslitDataSource.prototype.createCsiTimer_ = function $goog$ime$plugin$lang$TranslitDataSource$$createCsiTimer_$() {
  goog.ime.plugin.lang.TranslitDataSource.ENABLE_CSI && window.jstiming && window.jstiming.Timer && (this.timer_ = new window.jstiming.Timer)
};
goog.ime.plugin.lang.TranslitDataSource.prototype.tick_ = function $goog$ime$plugin$lang$TranslitDataSource$$tick_$(tickLabel, opt_preTickLabel) {
  this.timer_ && (opt_preTickLabel ? this.timer_.tick(tickLabel, opt_preTickLabel) : this.timer_.tick(tickLabel))
};
goog.ime.plugin.lang.TranslitDataSource.prototype.report_ = function $goog$ime$plugin$lang$TranslitDataSource$$report_$(request) {
  this.timer_ && (this.timer_.name = goog.ime.plugin.lang.TranslitDataSource.TimerName + request.query.getIMEName().replace(/-/g, "_"), window.jstiming.report(this.timer_))
};
goog.ime.plugin.lang.TranslitDataSource.prototype.getLastQueryInfo_ = function $goog$ime$plugin$lang$TranslitDataSource$$getLastQueryInfo_$(query, opt_inputTool) {
  var translitQuery = query;
  goog.isString(query) && opt_inputTool && (translitQuery = new goog.ime.plugin.lang.TranslitQuery(query, opt_inputTool));
  return translitQuery && translitQuery.isReverse ? translitQuery : this.lookupCache(translitQuery, this.lastQueryInfoMap_)
};
goog.ime.plugin.lang.TranslitDataSource.prototype.setLastQueryInfo = function $goog$ime$plugin$lang$TranslitDataSource$$setLastQueryInfo$(query) {
  var leafCache = this.findCacheLeaf(this.lastQueryInfoMap_, query.hashKey());
  query.isMultiSegmentQuery() ? leafCache[query.getText()] = query : goog.array.forEach(query.text, function(text, index) {
    leafCache[text] = query.getSingleTextQuery(index)
  })
};
goog.ime.plugin.lang.TranslitDataSource.prototype.clearLastQueryInfo = function $goog$ime$plugin$lang$TranslitDataSource$$clearLastQueryInfo$(query) {
  var leafCache = this.findCacheLeaf(this.lastQueryInfoMap_, query.hashKey());
  leafCache[query.getText()] = null
};
goog.ime.plugin.lang.TranslitDataSource.prototype.addToUserVotes_ = function $goog$ime$plugin$lang$TranslitDataSource$$addToUserVotes_$(word) {
  this.userVotes_[word] = !0;
  this.logger.info("Added " + word + " to user vote map")
};
goog.ime.plugin.lang.TranslitDataSource.prototype.lookupCallbackInternal = function $goog$ime$plugin$lang$TranslitDataSource$$lookupCallbackInternal$(request, success, response) {
  function processSegment(segment, continuation) {
    var origText = goog.string.unescapeEntities(segment.shift()), query = !reqQuery.isMultiSegmentQuery() && self.getLastQueryInfo_(origText, inputTool) || new goog.ime.plugin.lang.TranslitQuery(origText, inputTool);
    if(!segment.length) {
      return query.status = goog.ime.plugin.LookupQueryStatus.FAILED, continuation(query, null)
    }
    var transformations = segment.shift(), remainingResponse = segment;
    if(!origText || !transformations || !transformations.length) {
      if(origText && transformations && !reqQuery.isMultiSegmentQuery()) {
        var sugItemBuilder = self.buildSuggestionItem_, suggestions = [], suggestion = new goog.ime.plugin.lang.TranslitSuggestion(origText, suggestions), responseCache = self.findCacheLeaf(self.responseCache, hashKey);
        responseCache[origText] = suggestion
      }
      query.status = goog.ime.plugin.LookupQueryStatus.FAILED;
      return continuation(query, null)
    }
    self.logger.info(m + "lookup obtained for <" + origText + ">");
    sugItemBuilder = self.buildSuggestionItem_;
    suggestions = [];
    goog.array.forEach(transformations, function(transformation, j) {
      transformation && suggestions.push(sugItemBuilder(transformation, origText, remainingResponse, j))
    });
    suggestion = new goog.ime.plugin.lang.TranslitSuggestion(origText, suggestions);
    if(!reqQuery.isMultiSegmentQuery()) {
      responseCache = self.findCacheLeaf(self.responseCache, hashKey);
      responseCache[origText] = suggestion;
      var reverseCache = self.findCacheLeaf(self.reverseCache, hashKey);
      reverseCache[suggestion.getDefault()] = origText
    }
    isBulk || self.addToUserVotes_(origText);
    query.status = goog.ime.plugin.LookupQueryStatus.SUCCESS;
    return continuation(query, suggestion)
  }
  this.tick_(goog.ime.plugin.lang.TranslitDataSource.TickLabel.RESPONSE_BACK, goog.ime.plugin.lang.TranslitDataSource.TickLabel.REQUEST_SENT);
  this.report_(request);
  var m = "lookupCallbackInternal:", self = this, reqQuery = request.query, hashKey = reqQuery.hashKey(), callback = request.callback, text = request.text, isBulk = reqQuery.isBulk, inputTool = reqQuery.inputTool, success = !!(response && "SUCCESS" == response[0]), response = response && 1 < response.length ? response[1] : response;
  if(!success || !response) {
    if(reqQuery.isMultiSegmentQuery()) {
      var query$$0 = this.getLastQueryInfo_(reqQuery) || reqQuery;
      query$$0.status = goog.ime.plugin.LookupQueryStatus.FAILED;
      this.logger.info(m + "lookup failed for <" + text.join(",") + ">");
      callback(query$$0, !1, !1, null)
    }else {
      for(var i = 0;text && i < text.length;++i) {
        query$$0 = this.getLastQueryInfo_(text[i], inputTool) || new goog.ime.plugin.lang.TranslitQuery(text[i], inputTool), query$$0.status = goog.ime.plugin.LookupQueryStatus.FAILED, this.logger.info(m + "lookup failed for <" + text[i] + ">"), callback(query$$0, !1, !1, null)
      }
    }
  }else {
    if(reqQuery.isMultiSegmentQuery()) {
      var origText$$0 = goog.array.map(response, function(segment) {
        return goog.string.unescapeEntities(segment[0])
      }), isSuccess = !0, segmentedSuggestion = new goog.ime.plugin.lang.TranslitSuggestion(reqQuery.getText(), []);
      goog.array.forEach(response, function(segment) {
        segment && segment.length && processSegment(segment, function(query, suggestion) {
          query.status == goog.ime.plugin.LookupQueryStatus.SUCCESS && suggestion ? segmentedSuggestion.addSegmentSuggestion(suggestion) : isSuccess = !1
        })
      });
      var responseCache = self.findCacheLeaf(self.responseCache, hashKey);
      responseCache[reqQuery.getText()] = segmentedSuggestion;
      query$$0 = self.getLastQueryInfo_(reqQuery) || reqQuery;
      query$$0.status = isSuccess ? goog.ime.plugin.LookupQueryStatus.SUCCESS : goog.ime.plugin.LookupQueryStatus.FAILED;
      var segmentedQuery = goog.ime.plugin.lang.TranslitQuery.createMultiSegmentQuery(origText$$0, reqQuery.inputTool, reqQuery.getRequiredSugCount(), !1);
      query$$0.status == goog.ime.plugin.LookupQueryStatus.SUCCESS && !query$$0.isReverse && query$$0.getText() != segmentedQuery.getText() && (responseCache = self.findCacheLeaf(self.responseCache, hashKey), responseCache[segmentedQuery.getText()] = segmentedSuggestion, segmentedQuery.setQueriedSugCount(query$$0.getQueriedSugCount()), segmentedQuery.status = query$$0.status, this.setLastQueryInfo(segmentedQuery));
      callback(query$$0, !1, isSuccess, isSuccess ? segmentedSuggestion : null)
    }else {
      goog.array.forEach(response, function(segment) {
        segment && segment.length && processSegment(segment, function(query, suggestion) {
          var isSuccess = query.status == goog.ime.plugin.LookupQueryStatus.SUCCESS && !!suggestion;
          callback(query, !1, isSuccess, suggestion)
        })
      })
    }
  }
};
goog.ime.plugin.lang.TranslitDataSource.prototype.lookup = function $goog$ime$plugin$lang$TranslitDataSource$$lookup$(query, callback) {
  var m = "lookup:";
  this.logger.shout(m + "text<" + query.text + ">::reqd:" + query.getRequiredSugCount());
  var lastQueriedSugCount, lastQuery, suggestion, currentSugCount;
  query.useCache() && (lastQueriedSugCount = (lastQuery = this.getLastQueryInfo_(query)) ? lastQuery.getQueriedSugCount() : 0, currentSugCount = (suggestion = this.lookupCache(query)) ? suggestion.getSuggestionCount() : 0);
  var lookupResult, maxFetchSugCount = this.getDataSourceConfig(query).maxFetchSuggestionsCount;
  if(suggestion && query.getRequiredSugCount() <= currentSugCount) {
    this.logger.shout(m + "Already have required number of suggestions"), callback(query, !0, !0, suggestion), lookupResult = !0
  }else {
    if(!query.isReverse && (!lastQuery || !lastQuery.isComplete()) || lastQueriedSugCount < maxFetchSugCount && query.getRequiredSugCount() <= maxFetchSugCount && currentSugCount == lastQueriedSugCount) {
      this.logger.shout(m + "Enqueueing request for more suggestions");
      if(this.preferLatest) {
        this.requestQueue.enqueue(new goog.ime.datasource.RemoteDataRequest(query, callback))
      }else {
        var lastQueuedRequest = this.requestQueue.peek();
        lastQueuedRequest ? lastQueuedRequest.query.satisfies(query) || lastQueuedRequest.query.merge(query) || this.requestQueue.enqueue(new goog.ime.datasource.RemoteDataRequest(query, callback)) : this.requestQueue.enqueue(new goog.ime.datasource.RemoteDataRequest(query, callback))
      }
      lookupResult = !1
    }else {
      lastQueriedSugCount >= maxFetchSugCount ? this.logger.shout(m + "Already tried getting max suggestions. Do nothing.") : currentSugCount < lastQueriedSugCount && this.logger.shout(m + "Response contains fewer suggestions than queried.")
    }
  }
  this.processQueue();
  return lookupResult
};
goog.ime.plugin.lang.TranslitDataSource.prototype.sendRequest = function $goog$ime$plugin$lang$TranslitDataSource$$sendRequest$(request, callback) {
  var m = "sendRequest:", query = request.query, dsConfig = this.getDataSourceConfig(query);
  this.logger.info(m + "Sending request for <" + query.text + ">");
  var querySugCount = dsConfig.fetchSuggestionsCount, lastQuery = this.getLastQueryInfo_(query), lastQueriedSugCount = lastQuery ? lastQuery.getQueriedSugCount() : 0;
  0 < lastQueriedSugCount && (querySugCount = lastQueriedSugCount + dsConfig.fetchSuggestionsInc);
  query.setQueriedSugCount(Math.min(Math.max(querySugCount, query.getRequiredSugCount()), dsConfig.maxFetchSuggestionsCount));
  query.isReverse || this.setLastQueryInfo(query);
  var httpRequest = query.buildRequest(dsConfig, {uv:this.getUserVotes_(query.inputTool)});
  query.status = goog.ime.plugin.LookupQueryStatus.PENDING;
  request.id = this.asyncHttpService.send(httpRequest.url, httpRequest.payload, callback);
  this.tick_(goog.ime.plugin.lang.TranslitDataSource.TickLabel.REQUEST_SENT)
};
goog.ime.plugin.lang.TranslitDataSource.prototype.abortRequest = function $goog$ime$plugin$lang$TranslitDataSource$$abortRequest$(request) {
  var query = request.query, queriedSugCount = 0, lastQuery = this.getLastQueryInfo_(query);
  lastQuery && (queriedSugCount = lastQuery.getQueriedSugCount() - this.getDataSourceConfig(query).fetchSuggestionsInc, lastQuery.setQueriedSugCount(queriedSugCount), 0 >= queriedSugCount && this.clearLastQueryInfo(lastQuery));
  this.logger.shout("abortRequest:<" + query.text + ">:" + queriedSugCount);
  this.asyncHttpService.abort(request.id);
  query.status = goog.ime.plugin.LookupQueryStatus.ABORTED
};
goog.ime.plugin.lang.TranslitDataSource.prototype.updateDefault = function $goog$ime$plugin$lang$TranslitDataSource$$updateDefault$(query, newSuggestion) {
  var suggestion = this.lookupCache(query), inputText = suggestion.getInput();
  this.addToUserVotes_(inputText);
  if(newSuggestion != inputText) {
    suggestion.setDefault(newSuggestion);
    var reverseCache = this.findCacheLeaf(this.reverseCache, query.hashKey());
    reverseCache[newSuggestion] = inputText
  }
};
goog.ime.plugin.lang.TranslitDataSource.prototype.getUserVotes_ = function $goog$ime$plugin$lang$TranslitDataSource$$getUserVotes_$(inputTool) {
  var votesArray = [];
  goog.object.forEach(this.userVotes_, function(boolValue, inputText) {
    var query = new goog.ime.plugin.lang.TranslitQuery(inputText, inputTool), suggestion = this.lookupCache(query);
    suggestion && (votesArray.push(suggestion.getCountString()), this.logger.info("votesArray:" + votesArray), suggestion.clearCounts())
  }, this);
  var votesString = "";
  0 < votesArray.length && (votesString = votesArray.join(",") + ";0;0");
  this.logger.info("votes string : " + votesString);
  this.userVotes_ = {};
  return votesString
};
goog.ime.dom.Token = function $goog$ime$dom$Token$(textInput, startCaret, opt_endCaret) {
  goog.Disposable.call(this);
  this.textInput = textInput;
  this.reset(startCaret, opt_endCaret || startCaret.copy())
};
goog.inherits(goog.ime.dom.Token, goog.Disposable);
goog.ime.dom.Token.prototype.logger = goog.debug.Logger.getLogger("goog.ime.dom.Token");
goog.ime.dom.Token.prototype.disposeInternal = function $goog$ime$dom$Token$$disposeInternal$() {
  this.textInput = this.originalCaret = this.endCaret = this.startCaret = null
};
goog.ime.dom.Token.prototype.getId = function $goog$ime$dom$Token$$getId$() {
  if(!this.id_) {
    for(var dom = this.textInput.getDomHelper();dom.getElement(this.id_ = this.textInput.generateNodeId());) {
    }
  }
  return this.id_
};
goog.ime.dom.Token.prototype.getStart = function $goog$ime$dom$Token$$getStart$() {
  return this.startCaret
};
goog.ime.dom.Token.prototype.getEnd = function $goog$ime$dom$Token$$getEnd$() {
  return this.endCaret
};
goog.ime.dom.Token.prototype.isValid = function $goog$ime$dom$Token$$isValid$() {
  return!!this.startCaret && !!this.endCaret && this.startCaret.isValid() && this.endCaret.isValid()
};
goog.ime.dom.Token.prototype.isEmpty = function $goog$ime$dom$Token$$isEmpty$() {
  return this.startCaret.equals(this.endCaret)
};
goog.ime.dom.Token.prototype.move = function $goog$ime$dom$Token$$move$(delta) {
  this.startCaret.move(delta);
  this.endCaret.move(delta)
};
goog.ime.dom.Token.prototype.saveCurrentText = function $goog$ime$dom$Token$$saveCurrentText$() {
  this.originalText = this.getText()
};
goog.ime.dom.Token.prototype.setOriginalCaret = function $goog$ime$dom$Token$$setOriginalCaret$(caret) {
  this.originalCaret = caret.copy()
};
goog.ime.dom.Token.prototype.restoreOriginalCaret = function $goog$ime$dom$Token$$restoreOriginalCaret$() {
  try {
    this.textInput.setCaret(this.originalCaret)
  }catch(e) {
    this.logger.warning("restoreOriginalCaret:Could not update the caret.")
  }
};
goog.ime.dom.Token.prototype.getText = function $goog$ime$dom$Token$$getText$() {
  if(this.isText()) {
    var text = this.startCaret.getAdjacentText();
    return text.substring(this.startCaret.offset, this.endCaret.offset)
  }
  return""
};
goog.ime.dom.Token.prototype.isTextChanged = function $goog$ime$dom$Token$$isTextChanged$() {
  return this.originalText != this.getText()
};
ITA_FLAGS_DEBUG && (goog.ime.dom.Token.prototype.toString = function $goog$ime$dom$Token$$toString$() {
  return"start::" + this.startCaret + ",end::" + this.endCaret
});
goog.ime.dom.Token.prototype.copy = function $goog$ime$dom$Token$$copy$() {
  return new this.constructor(this.textInput, this.startCaret.copy(), this.endCaret.copy())
};
goog.ime.dom.Token.prototype.reset = function $goog$ime$dom$Token$$reset$(startCaret, endCaret) {
  this.logger.info("reset:before->" + this);
  this.startCaret = startCaret;
  this.endCaret = endCaret;
  this.logger.info("reset:after->" + this)
};
goog.ime.plugin.lang.TranslitParser = function $goog$ime$plugin$lang$TranslitParser$() {
  this.continuationCharsMap_ = {};
  this.initContinuationChars_()
};
goog.ime.plugin.lang.TranslitParser.prototype.logger = goog.debug.Logger.getLogger("goog.ime.plugin.lang.TranslitParser");
goog.ime.plugin.lang.TranslitParser.prototype.findToken = function $goog$ime$plugin$lang$TranslitParser$$findToken$(token, langCodePair, opt_findEnd) {
  this.logger.config("findToken:langCodePair:" + langCodePair);
  var endCaret = token.getEnd(), startCaret = token.getStart(), text = endCaret.getAdjacentText();
  this.logger.config("current caret:" + startCaret.offset);
  this.logger.config("text at caret:<" + text + ">");
  for(var charAtCaret;0 < startCaret.offset;) {
    if(startCaret.move(-1), charAtCaret = startCaret.getNextChar(), this.logger.fine("findToken:findStart:charAtCaret:<" + charAtCaret + ">"), this.isDelimiter(langCodePair, charAtCaret)) {
      this.logger.fine("findToken:findStart:delimiter:<" + charAtCaret + ">");
      startCaret.move(1);
      break
    }
  }
  this.logger.config("startCaret:" + startCaret.offset);
  if(opt_findEnd) {
    for(var textLength = text.length;endCaret.offset < textLength;) {
      charAtCaret = endCaret.getNextChar();
      this.logger.fine("findToken:findEnd:charAtCaret:<" + charAtCaret + ">");
      if(this.isDelimiter(langCodePair, charAtCaret)) {
        this.logger.fine("findToken:findEnd:delimiter:<" + charAtCaret + ">");
        break
      }
      endCaret.move(1)
    }
  }
  this.logger.config("endCaret:" + endCaret.offset)
};
goog.ime.plugin.lang.TranslitParser.prototype.isDelimiter = function $goog$ime$plugin$lang$TranslitParser$$isDelimiter$(langCodePair, ch) {
  var sourceLang = goog.ime.lang.Language.get(langCodePair.sourceLangCode);
  return!sourceLang.isAlphaDigit(ch) && !this.isContinuationChar(langCodePair, ch)
};
goog.ime.plugin.lang.TranslitParser.prototype.setContinuationChars = function $goog$ime$plugin$lang$TranslitParser$$setContinuationChars$(langCodePair, continuationChars) {
  this.continuationCharsMap_[langCodePair] = continuationChars
};
goog.ime.plugin.lang.TranslitParser.prototype.isContinuationChar = function $goog$ime$plugin$lang$TranslitParser$$isContinuationChar$(langCodePair, ch) {
  return!!this.continuationCharsMap_[langCodePair] && goog.string.contains(this.continuationCharsMap_[langCodePair], ch)
};
goog.ime.plugin.lang.TranslitParser.prototype.isTransliterated = function $goog$ime$plugin$lang$TranslitParser$$isTransliterated$(langCodePair, ch) {
  var targetLanguage = goog.ime.lang.Language.get(langCodePair.targetLangCode);
  return targetLanguage.isAlphaDigit(ch)
};
goog.ime.plugin.lang.TranslitParser.prototype.isTransliteratable = function $goog$ime$plugin$lang$TranslitParser$$isTransliteratable$(langCodePair, text) {
  if(!text) {
    return!1
  }
  this.logger.config("isTransliteratable:langCodePair:" + langCodePair);
  for(var i = text.length - 1;0 <= i;i--) {
    if(this.isDelimiter(langCodePair, text.charAt(i))) {
      return!1
    }
  }
  return!0
};
goog.ime.plugin.lang.TranslitParser.prototype.initContinuationChars_ = function $goog$ime$plugin$lang$TranslitParser$$initContinuationChars_$() {
  var en_am = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.AMHARIC);
  this.setContinuationChars(en_am, "`");
  var en_ar = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.ARABIC);
  this.setContinuationChars(en_ar, "`_-'");
  var en_iw = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.HEBREW);
  this.setContinuationChars(en_iw, "'");
  var en_fa = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.PERSIAN);
  this.setContinuationChars(en_fa, "`'");
  var en_ru = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.RUSSIAN);
  this.setContinuationChars(en_ru, "'");
  var en_sr = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.SERBIAN);
  this.setContinuationChars(en_sr, "\u0106\u0107\u010c\u010d\u0110\u0111\u0160\u0161\u017d\u017e");
  var en_ti = goog.ime.lang.LanguageCodePair.get(goog.ime.lang.LanguageCode.ENGLISH, goog.ime.lang.LanguageCode.TIGRINYA);
  this.setContinuationChars(en_ti, "`")
};
goog.ime.plugin.lang.TranslitSuggestionPlugin = function $goog$ime$plugin$lang$TranslitSuggestionPlugin$(parser, dataSource, suggestionMenuRenderer) {
  goog.ime.plugin.TransformationPlugin.call(this);
  this.parser_ = parser;
  this.dataSource_ = dataSource;
  this.suggestionMenuRenderer_ = suggestionMenuRenderer;
  this.textInputStatus_ = {keyCode:-1, lastKey:-1}
};
goog.inherits(goog.ime.plugin.lang.TranslitSuggestionPlugin, goog.ime.plugin.TransformationPlugin);
goog.ime.plugin.lang.TranslitSuggestionPlugin.prototype.isSupportedInputTool = function $goog$ime$plugin$lang$TranslitSuggestionPlugin$$isSupportedInputTool$(inputTool) {
  return goog.array.contains(goog.ime.plugin.lang.InputMethodFeatureConfig.getInputMethodsWithTransform(), inputTool.code)
};
goog.ime.plugin.lang.TranslitSuggestionPlugin.prototype.logger = goog.debug.Logger.getLogger("goog.ime.plugin.lang.TranslitSuggestionPlugin");
goog.ime.plugin.lang.TranslitSuggestionPlugin.prototype.getEventTypes = function $goog$ime$plugin$lang$TranslitSuggestionPlugin$$getEventTypes$() {
  return[goog.events.EventType.CLICK, goog.events.EventType.KEYDOWN, goog.events.EventType.KEYPRESS, goog.events.EventType.KEYUP]
};
goog.ime.plugin.lang.TranslitSuggestionPlugin.prototype.ignoreEvent_ = function $goog$ime$plugin$lang$TranslitSuggestionPlugin$$ignoreEvent_$(control, e) {
  return goog.ime.plugin.EventUtil.isModifierEvent(e)
};
goog.ime.plugin.lang.TranslitSuggestionPlugin.prototype.updateSuggestion_ = function $goog$ime$plugin$lang$TranslitSuggestionPlugin$$updateSuggestion_$(textInput, token, query, success, updatedSuggestion) {
  var queryText = query.getText();
  if(!success || !updatedSuggestion) {
    token.restoreOriginalCaret()
  }else {
    this.dataSource_.updateDefault(query, updatedSuggestion);
    var langCodePair = query.inputTool.getLanguagePair();
    this.parser_.isTransliteratable(langCodePair, updatedSuggestion) && (updatedSuggestion += " ");
    this.logger.info("updateSuggestion_:Replacing : <" + queryText + "> with <" + updatedSuggestion + ">");
    token.replace(updatedSuggestion);
    token.placeCaret(!0)
  }
  token.dispose();
  textInput.setFocus()
};
goog.ime.plugin.lang.TranslitSuggestionPlugin.prototype.showSuggestionMenu_ = function $goog$ime$plugin$lang$TranslitSuggestionPlugin$$showSuggestionMenu_$(control, caret, token, shouldReplaceText, query, sync, success, suggestion) {
  if(success && suggestion && query.getText() == token.getText()) {
    this.logger.info("Showing suggestion for :" + query.getText());
    token.setOriginalCaret(caret);
    shouldReplaceText && (token.replace(suggestion.getInput()), this.logger.info("Text has been replaced to <" + suggestion.getInput() + ">"));
    var updateSuggestionCallback = goog.bind(this.updateSuggestion_, this, control, token, query), targetLang = goog.ime.lang.Language.get(query.inputTool.languageCode), style = {};
    style.direction = targetLang.isRightToLeft() ? "rtl" : "ltr";
    var recommendedStyle = targetLang.getRecommendedStyle();
    recommendedStyle && recommendedStyle.lineHeight && (style["line-height"] = recommendedStyle.lineHeight);
    recommendedStyle && recommendedStyle.fontSize && (style["font-size"] = recommendedStyle.fontSize + "px");
    this.suggestionMenuRenderer_.render(control, token.getPosition(void 0, !0), suggestion, updateSuggestionCallback, style)
  }
};
goog.ime.plugin.lang.TranslitSuggestionPlugin.prototype.handleEventInternal = function $goog$ime$plugin$lang$TranslitSuggestionPlugin$$handleEventInternal$(control, e) {
  if(this.ignoreEvent_(control, e)) {
    return!1
  }
  var keyEvent = null;
  if(e.type == goog.events.EventType.KEYDOWN || e.type == goog.events.EventType.KEYPRESS || e.type == goog.events.EventType.KEYUP) {
    if(keyEvent = goog.ime.plugin.EventUtil.generateKeyEvent(e, this.textInputStatus_), !keyEvent) {
      return!1
    }
  }
  var sugMenu = this.suggestionMenuRenderer_.getMenu(control);
  if(sugMenu.isVisible()) {
    if(keyEvent && (keyEvent.keyCode == goog.events.KeyCodes.ESC || keyEvent.keyCode == goog.events.KeyCodes.UP || keyEvent.keyCode == goog.events.KeyCodes.DOWN || keyEvent.keyCode == goog.events.KeyCodes.SPACE || keyEvent.keyCode == goog.events.KeyCodes.ENTER)) {
      return sugMenu.handleKeyEvent(keyEvent), !0
    }
    sugMenu.hide();
    return!1
  }
  var isBackspace = !1;
  if(control.isRangeCollapsed() && (e.type == goog.events.EventType.CLICK || (isBackspace = keyEvent.keyCode == goog.events.KeyCodes.BACKSPACE))) {
    var token = control.getSelectionToken();
    if(!token || !token.isText() || !token.isEmpty()) {
      return this.logger.info("No caret detail, Event discarded"), !1
    }
    var caret = token.getStart().copy(), nextChar = caret.getNextChar(), prevChar = caret.getPrevChar(), langCodePair = this.currentInputTool.getLanguagePair();
    if(isBackspace) {
      if(this.parser_.isTransliterated(langCodePair, nextChar)) {
        return this.logger.info("Next char<" + nextChar + "> is of target lang:noop"), !1
      }
    }else {
      if(!this.parser_.isTransliterated(langCodePair, prevChar) || !this.parser_.isTransliterated(langCodePair, nextChar)) {
        return this.logger.info("There is not next/prev char of the target language; i.e. User clicked at the edge:Do nothing"), !1
      }
    }
    this.parser_.findToken(token, langCodePair.inverse(), !isBackspace);
    if(token.isEmpty()) {
      return this.logger.info("Empty token to show corrections:Do nothing"), !1
    }
    token.saveCurrentText();
    var targetLangWord = token.getText(), sourceLanguage = goog.ime.lang.Language.get(langCodePair.sourceLangCode);
    if(sourceLanguage.isWord(targetLangWord)) {
      return!1
    }
    this.logger.info("Looking up suggestion for:<" + targetLangWord + ">");
    var translitQuery = new goog.ime.plugin.lang.TranslitQuery(targetLangWord, langCodePair, !0), lookupHandled = goog.isBoolean(this.dataSource_.lookup(translitQuery, goog.bind(this.showSuggestionMenu_, this, control, caret, token, isBackspace)));
    return lookupHandled
  }
  return!1
};
goog.ime.plugin.lang.TranslitSuggestionPlugin.prototype.execCommandInternal = function $goog$ime$plugin$lang$TranslitSuggestionPlugin$$execCommandInternal$(cmd, var_args) {
  var clazz = goog.ime.plugin.lang.TranslitSuggestionPlugin.superClass_;
  clazz.execCommandInternal.apply(this, arguments);
  if(cmd == goog.ime.plugin.CommandType.CHANGE_STATE && this.currentTextInput) {
    var sugMenu = this.suggestionMenuRenderer_.getMenu(this.currentTextInput);
    sugMenu && sugMenu.hide()
  }
};
goog.ime.dom.isIframe = function $goog$ime$dom$isIframe$(element) {
  return element.tagName.toUpperCase() == goog.dom.TagName.IFRAME
};
goog.ime.dom.exposeNode = function $goog$ime$dom$exposeNode$(node) {
  return(node.tagName || node.nodeValue) + (node.id ? "#" + node.id : "") + ':"' + (node.innerHTML || "") + '"'
};
goog.ime.dom.isTextNode = function $goog$ime$dom$isTextNode$(node) {
  return!!node && node.nodeType == goog.dom.NodeType.TEXT
};
goog.ime.dom.hasCustomStyles = function $goog$ime$dom$hasCustomStyles$(element) {
  if(!goog.string.isEmptySafe(element.style.cssText)) {
    return!0
  }
  var classes = goog.dom.classes.get(element);
  return classes.length ? !0 : !1
};
goog.ime.dom.mergeAdjacentText = function $goog$ime$dom$mergeAdjacentText$(node, moveForward) {
  if(goog.ime.dom.isTextNode(node)) {
    for(var nextNodeFn = moveForward ? "nextSibling" : "previousSibling", prevNodeFn = moveForward ? "previousSibling" : "nextSibling", nodeValues = [node.nodeValue];goog.ime.dom.isTextNode(node[nextNodeFn]);) {
      node = node[nextNodeFn], nodeValues.push(node.nodeValue), goog.dom.removeNode(node[prevNodeFn])
    }
    moveForward || nodeValues.reverse();
    var newNodeValue = nodeValues.join("");
    node.nodeValue != newNodeValue && (node.nodeValue = newNodeValue)
  }
  return node
};
goog.ime.dom.Caret = function $goog$ime$dom$Caret$(container, offset) {
  goog.Disposable.call(this);
  this.container = container;
  this.offset = offset
};
goog.inherits(goog.ime.dom.Caret, goog.Disposable);
ITA_FLAGS_DEBUG && (goog.ime.dom.Caret.prototype.toString = function $goog$ime$dom$Caret$$toString$() {
  return"offset:" + this.offset + ", text:" + this.getAdjacentText()
});
goog.ime.dom.Caret.prototype.disposeInternal = function $goog$ime$dom$Caret$$disposeInternal$() {
  this.container = null
};
goog.ime.dom.Caret.prototype.equals = function $goog$ime$dom$Caret$$equals$(caret) {
  return!!caret && this.container == caret.container && this.offset == caret.offset
};
goog.ime.dom.Caret.prototype.getPrevChar = function $goog$ime$dom$Caret$$getPrevChar$() {
  return this.getCharAtOffset(this.offset - 1)
};
goog.ime.dom.Caret.prototype.getNextChar = function $goog$ime$dom$Caret$$getNextChar$() {
  return this.getCharAtOffset(this.offset)
};
goog.ime.dom.Caret.prototype.getText_ = function $goog$ime$dom$Caret$$getText_$(start, opt_end) {
  var text = this.getAdjacentText();
  return goog.isDefAndNotNull(opt_end) ? text.substring(start, opt_end) : text.substring(start)
};
goog.ime.dom.Caret.prototype.getAfterText = function $goog$ime$dom$Caret$$getAfterText$() {
  return this.getText_(this.offset)
};
goog.ime.dom.Caret.prototype.getBeforeText = function $goog$ime$dom$Caret$$getBeforeText$() {
  return this.getText_(0, this.offset)
};
goog.ime.dom.Caret.prototype.getCharAtOffset = function $goog$ime$dom$Caret$$getCharAtOffset$(offset) {
  var adjacentText = this.getAdjacentText(), adjacentTextLength = adjacentText.length;
  return offset <= adjacentTextLength && offset >= 0 ? adjacentText.charAt(offset) : ""
};
goog.ime.dom.Caret.prototype.move = function $goog$ime$dom$Caret$$move$(numChars) {
  return this.moveTo(this.offset + numChars)
};
goog.ime.dom.RichTextCaret = function $goog$ime$dom$RichTextCaret$(container, node, offset) {
  goog.ime.dom.Caret.call(this, container, offset);
  this.node = node
};
goog.inherits(goog.ime.dom.RichTextCaret, goog.ime.dom.Caret);
goog.ime.dom.RichTextCaret.prototype.disposeInternal = function $goog$ime$dom$RichTextCaret$$disposeInternal$() {
  this.node = null
};
goog.ime.dom.RichTextCaret.prototype.copy = function $goog$ime$dom$RichTextCaret$$copy$() {
  return new goog.ime.dom.RichTextCaret(this.container, this.node, this.offset)
};
goog.ime.dom.RichTextCaret.prototype.equals = function $goog$ime$dom$RichTextCaret$$equals$(caret) {
  return goog.ime.dom.RichTextCaret.superClass_.equals.call(this, caret) && this.node == caret.node
};
goog.ime.dom.RichTextCaret.prototype.isText = function $goog$ime$dom$RichTextCaret$$isText$() {
  return!!this.node && this.node.nodeType == goog.dom.NodeType.TEXT
};
goog.ime.dom.RichTextCaret.prototype.getAdjacentText = function $goog$ime$dom$RichTextCaret$$getAdjacentText$() {
  return this.node.nodeValue || ""
};
goog.ime.dom.RichTextCaret.prototype.isValid = function $goog$ime$dom$RichTextCaret$$isValid$() {
  return!!this.container.ownerDocument && !!this.container.parentNode && goog.dom.contains(this.container, this.node) && 0 <= this.offset && this.offset <= goog.editor.node.getLength(this.node)
};
goog.ime.dom.RichTextCaret.prototype.moveTo = function $goog$ime$dom$RichTextCaret$$moveTo$(newOffset) {
  var adjacentText = this.getAdjacentText(), adjacentTextLength = adjacentText.length;
  newOffset <= adjacentTextLength && 0 <= newOffset && (this.offset = newOffset);
  return this
};
goog.ime.dom.RichTextCaret.prototype.reset = function $goog$ime$dom$RichTextCaret$$reset$(node, offset) {
  var nodeLength = goog.editor.node.getLength(node);
  goog.asserts.assert(0 <= offset && offset <= nodeLength);
  this.node = node;
  this.offset = offset
};
goog.ime.dom.RichTextCaret.prototype.getBeforeFixText = function $goog$ime$dom$RichTextCaret$$getBeforeFixText$(opt_length) {
  var text;
  if(this.node == this.container) {
    text = goog.dom.getTextContent(this.node).substring(0, this.offset), text = opt_length && this.offset > opt_length ? text.substring(this.offset - opt_length, this.offset) : text.substring(0, this.offset)
  }else {
    text = "";
    for(var layerTextSb = new goog.string.StringBuffer, currentNode = this.node;currentNode && currentNode != this.container;) {
      for(var child = currentNode.parentNode.childNodes, i = 0;i < child.length;i++) {
        var childText = goog.dom.getTextContent(child[i]);
        if(this.node == child[i]) {
          layerTextSb.append(childText.substring(0, this.offset));
          break
        }else {
          if(currentNode == child[i]) {
            break
          }else {
            " " != childText && layerTextSb.append(childText)
          }
        }
      }
      text = layerTextSb.append(text).toString();
      layerTextSb.clear();
      if(opt_length && text.length > opt_length) {
        text = text.substring(text.length - opt_length);
        break
      }
      currentNode = currentNode.parentNode
    }
  }
  return text
};
goog.ime.style = {};
goog.ime.style.getStyle = function $goog$ime$style$getStyle$(el, styleName) {
  return goog.style.getComputedStyle(el, styleName) || goog.style.getCascadedStyle(el, styleName) || el.style[styleName]
};
goog.ime.style.getPageOffset = function $goog$ime$style$getPageOffset$(el) {
  var x = el.offsetLeft, y = el.offsetTop, parent = el.offsetParent;
  if(parent) {
    var positionStyle = goog.style.getComputedPosition(parent);
    if("relative" != positionStyle && "absolute" != positionStyle) {
      var pageOffset = goog.ime.style.getPageOffset(parent), x = x + pageOffset.x, y = y + pageOffset.y
    }else {
      for(;parent.offsetParent;) {
        x -= parent.offsetParent.scrollLeft, y -= parent.offsetParent.scrollTop, parent = parent.offsetParent
      }
    }
  }
  return new goog.math.Coordinate(x, y)
};
goog.ime.positioning = {};
goog.ime.positioning.logger = goog.debug.Logger.getLogger("goog.ime.positioning");
goog.ime.positioning.getTextPosition = function $goog$ime$positioning$getTextPosition$(startCaret, opt_endCaret, opt_corner, opt_isFixOffset) {
  var textField = startCaret.container;
  return goog.userAgent.IE && goog.userAgent.isVersion(8) && !goog.userAgent.isVersion(9) && textField.type && "TEXTAREA" == textField.type.toUpperCase() ? goog.ime.positioning.getTextPositionIE(startCaret, opt_endCaret, opt_corner, opt_isFixOffset) : goog.ime.positioning.getTextPositionW3c_(startCaret, opt_endCaret, opt_corner)
};
goog.ime.positioning.getTextPositionW3c_ = function $goog$ime$positioning$getTextPositionW3c_$(startCaret, opt_endCaret, opt_corner) {
  var textField = startCaret.container, dom = goog.dom.getDomHelper(textField), endCaret = opt_endCaret || startCaret.copy().move(1);
  goog.ime.positioning.logger.fine("Get end coordinates of [" + startCaret + "]");
  var fieldHashCode = goog.getUid(textField), helperPreId = "_h#" + fieldHashCode, helperPre = dom.getElement(helperPreId);
  helperPre ? dom.removeChildren(helperPre) : helperPre = dom.createDom(goog.dom.TagName.PRE, {id:helperPreId});
  helperPre.parentNode || goog.dom.getOwnerDocument(textField).body.appendChild(helperPre);
  var startIndex = startCaret.offset, endIndex = endCaret.offset;
  dom.appendChild(helperPre, dom.createTextNode(textField.value.substring(0, startIndex)));
  var markerSpan = dom.createElement(goog.dom.TagName.SPAN);
  markerSpan.innerHTML = textField.value.substring(startIndex, endIndex) || String.fromCharCode(160);
  dom.appendChild(helperPre, markerSpan);
  dom.appendChild(helperPre, dom.createTextNode(textField.value.substring(endIndex)));
  helperPre.style.cssText = textField.style.cssText;
  var classes = goog.dom.classes.get(textField);
  goog.array.forEach(classes, function(classname) {
    goog.dom.classes.add(helperPre, classname)
  });
  goog.userAgent.IE && !goog.userAgent.isVersion("8") ? (helperPre.style.whiteSpace = "pre", helperPre.style.wordWrap = "break-word") : (helperPre.style.whiteSpace = "pre-wrap", helperPre.style.wordWrap = goog.ime.style.getStyle(textField, "wordWrap") || "");
  helperPre.style.fontFamily = goog.style.getFontFamily(textField);
  try {
    helperPre.style.fontSize = goog.style.getFontSize(textField) + "px"
  }catch(e) {
  }
  if(!helperPre.style.fontSize || "0px" == helperPre.style.fontSize) {
    helperPre.style.fontSize = goog.ime.positioning.DEFAULT_FONTSIZE_
  }
  helperPre.style.fontWeight = goog.ime.style.getStyle(textField, "fontWeight");
  helperPre.style.fontStyle = goog.ime.style.getStyle(textField, "fontStyle");
  helperPre.style.textTransform = goog.ime.style.getStyle(textField, "textTransform");
  helperPre.style.textDecoration = goog.ime.style.getStyle(textField, "textDecoration");
  helperPre.style.lineHeight = goog.ime.style.getStyle(textField, "lineHeight");
  helperPre.style.letterSpacing = goog.ime.style.getStyle(textField, "letterSpacing");
  helperPre.style.wordSpacing = goog.ime.style.getStyle(textField, "wordSpacing");
  helperPre.style.direction = goog.style.isRightToLeft(textField) ? "rtl" : "ltr";
  helperPre.style.textAlign = goog.style.getComputedTextAlign(textField) || "start";
  helperPre.style.verticalAlign = goog.ime.style.getStyle(textField, "verticalAlign");
  var marginBox = goog.style.getMarginBox(textField);
  helperPre.style.marginTop = marginBox.top + "px";
  helperPre.style.marginRight = marginBox.right + "px";
  helperPre.style.marginBottom = marginBox.bottom + "px";
  helperPre.style.marginLeft = marginBox.left + "px";
  var borderBox = goog.style.getBorderBox(textField);
  helperPre.style.borderTop = borderBox.top + "px solid red";
  helperPre.style.borderRight = borderBox.right + "px solid red";
  helperPre.style.borderBottom = borderBox.bottom + "px solid red";
  helperPre.style.borderLeft = borderBox.left + "px solid red";
  var paddingBox = goog.style.getPaddingBox(textField);
  helperPre.style.paddingTop = paddingBox.top + "px";
  helperPre.style.paddingRight = paddingBox.right + "px";
  helperPre.style.paddingBottom = paddingBox.bottom + "px";
  helperPre.style.paddingLeft = paddingBox.left + "px";
  helperPre.style.visibility = "hidden";
  var ox = goog.style.getComputedOverflowX(textField);
  helperPre.style.overflowX = !ox || "visible" == ox ? "auto" : ox;
  var oy = goog.style.getComputedOverflowY(textField);
  helperPre.style.overflowY = !oy || "visible" == oy ? "auto" : oy;
  goog.style.setSize(helperPre, goog.style.getSize(textField));
  var width = helperPre.style.width, width = width.substring(0, width.length - 2), widthNumber = new Number(width) - 4;
  helperPre.style.width = (4 > widthNumber ? 4 : widthNumber) + "px";
  helperPre.scrollTop = textField.scrollTop;
  helperPre.scrollLeft = textField.scrollLeft;
  goog.style.setPosition(helperPre, goog.style.getPageOffset(textField));
  helperPre.style.position = "absolute";
  helperPre.style.zIndex = "-9";
  return textField.tagName.toUpperCase() == goog.dom.TagName.INPUT && (markerSpan.offsetTop >= textField.offsetHeight || markerSpan.offsetLeft >= textField.offsetWidth) ? goog.ime.positioning.getSpanPosition(textField, goog.positioning.Corner.BOTTOM_END) : goog.ime.positioning.getSpanPosition(markerSpan, opt_corner)
};
goog.ime.positioning.getTextPositionIE = function $goog$ime$positioning$getTextPositionIE$(startCaret, opt_endCaret, opt_corner, opt_isFixOffset) {
  var textField = startCaret.container, endCaret = opt_endCaret || startCaret.copy().move(1), domHelper = goog.dom.getDomHelper(textField), range = goog.dom.Range.createFromWindow(domHelper.getWindow()).getBrowserRangeObject(), boundingRect = range.getBoundingClientRect(), rangeWidth = 0, fixedX = 0, fixedY = 0;
  if(goog.dom.getDomHelper(startCaret.container).getWindow().frameElement) {
    var frameCoords = goog.style.getClientPosition(domHelper.getWindow().frameElement), fixedX = frameCoords.x, fixedY = frameCoords.y
  }
  var startIndex = startCaret.offset, endIndex = endCaret.offset, transferWord = textField.value.substring(startIndex, endIndex) || String.fromCharCode(160);
  domHelper.getDocument();
  var boundingHeight;
  try {
    boundingHeight = goog.style.getFontSize(textField) + 2
  }catch(e) {
    boundingHeight = 16
  }
  var boundingLeft;
  if(goog.style.isRightToLeft(textField)) {
    for(var startRange = range.duplicate();startRange.boundingHeight <= boundingHeight && startRange.htmlText == startRange.text && !(rangeWidth = range.boundingLeft - startRange.boundingLeft, 0 == startRange.moveStart("character", -1));) {
    }
    var minLeft = goog.style.getPageOffset(textField).x;
    boundingLeft = Math.max(boundingRect.left - rangeWidth, minLeft);
    opt_isFixOffset && (boundingLeft += 4 * transferWord.length)
  }else {
    boundingLeft = boundingRect.left, opt_isFixOffset && (boundingLeft -= 4 * transferWord.length)
  }
  return new goog.positioning.ViewportClientPosition(boundingLeft + fixedX, boundingRect.top + boundingHeight + fixedY)
};
goog.ime.positioning.getSpanPosition = function $goog$ime$positioning$getSpanPosition$(spanNode, opt_corner) {
  return new goog.positioning.MenuAnchoredPosition(spanNode, opt_corner || goog.positioning.Corner.BOTTOM_START, !0, !1)
};
goog.ime.positioning.DEFAULT_FONTSIZE_ = "13px";
goog.ime.dom.RichTextToken = function $goog$ime$dom$RichTextToken$(textInput, startCaret, opt_endCaret, opt_range) {
  goog.ime.dom.Token.call(this, textInput, startCaret, opt_endCaret);
  this.domHelper_ = textInput.getDomHelper();
  this.preserved_ = !1;
  this.paddingText_ = null;
  this.range_ = opt_range || null
};
goog.inherits(goog.ime.dom.RichTextToken, goog.ime.dom.Token);
goog.ime.dom.RichTextToken.prototype.logger_ = goog.debug.Logger.getLogger("goog.ime.dom.RichTextToken");
goog.ime.dom.RichTextToken.prototype.disposeInternal = function $goog$ime$dom$RichTextToken$$disposeInternal$() {
  this.textInput.unregisterToken(this);
  this.saveCurrentCaret_();
  this.cleanContentsDom_();
  this.restoreCaret_();
  this.currentCaretRange_ = this.domHelper_ = null
};
goog.ime.dom.RichTextToken.prototype.getRange = function $goog$ime$dom$RichTextToken$$getRange$() {
  return this.range_ || goog.dom.Range.createFromNodes(this.startCaret.node, this.startCaret.offset, this.endCaret.node, this.endCaret.offset)
};
goog.ime.dom.RichTextToken.prototype.getText = function $goog$ime$dom$RichTextToken$$getText$() {
  var text = goog.ime.dom.RichTextToken.superClass_.getText.call(this);
  return text || this.getRange().getText()
};
goog.ime.dom.RichTextToken.prototype.isText = function $goog$ime$dom$RichTextToken$$isText$() {
  return this.startCaret.isText() && this.startCaret.node == this.endCaret.node
};
goog.ime.dom.RichTextToken.prototype.preserve = function $goog$ime$dom$RichTextToken$$preserve$() {
  var m = "preserve:";
  if(!this.preserved_) {
    this.originalText || (this.originalText = this.paddingText_ = "\u200b");
    if(!this.isEmpty() && !this.isText()) {
      var spanElement = this.domHelper_.createDom("SPAN", {id:this.getId()}, ""), editor = this.textInput.getEditableElement(), endNode = this.getRange().getEndNode();
      endNode == editor && (endNode = editor.lastChild);
      goog.dom.insertSiblingAfter(spanElement, endNode);
      goog.editor.range.placeCursorNextTo(spanElement, !1)
    }else {
      var start = this.startCaret, end = this.endCaret, endNode = end.node, isNodeEditableElement = endNode == this.textInput.getEditableElement(), parentNode = endNode.parentNode;
      if(!isNodeEditableElement && "SPAN" == parentNode.tagName.toUpperCase() && goog.string.isEmptySafe(parentNode.id) && goog.string.trim(this.domHelper_.getTextContent(parentNode)) == this.getText()) {
        parentNode.id = this.getId(), this.logger_.info(m + "Used parent span:<" + parentNode.innerHTML + ">")
      }else {
        var oldStartOffset = start.offset, tokenRange = this.getRange(), insertedSpan = tokenRange.replaceContentsWithNode(this.domHelper_.createDom("SPAN", {id:this.getId()})), textNode = this.domHelper_.createTextNode(this.originalText);
        insertedSpan.appendChild(textNode);
        this.logger_.info(m + "Created span :<" + this.originalText + ">");
        start.reset(textNode, 0);
        end.reset(textNode, textNode.nodeValue.length);
        this.originalCaret && this.originalCaret.reset(textNode, this.originalCaret.offset - oldStartOffset);
        goog.editor.range.placeCursorNextTo(insertedSpan, !1)
      }
    }
    this.textInput.registerToken(this);
    this.preserved_ = !0
  }
};
goog.ime.dom.RichTextToken.prototype.saveCurrentCaret_ = function $goog$ime$dom$RichTextToken$$saveCurrentCaret_$() {
  if(this.currentCaretRange_) {
    return!1
  }
  var richeditControl = this.textInput, selRange = richeditControl.getSelectionRange();
  return selRange ? (this.logger_.info("saveCurrentCaret_"), this.currentCaretRange_ = goog.editor.range.saveUsingNormalizedCarets(selRange), !0) : !1
};
goog.ime.dom.RichTextToken.prototype.restoreCaret_ = function $goog$ime$dom$RichTextToken$$restoreCaret_$() {
  if(this.currentCaretRange_) {
    this.logger_.info("restoreCaret_");
    try {
      this.currentCaretRange_.restore()
    }catch(e) {
    }
    this.currentCaretRange_ = null
  }
};
goog.ime.dom.RichTextToken.prototype.getSpanElement_ = function $goog$ime$dom$RichTextToken$$getSpanElement_$() {
  for(var el;el = this.domHelper_.getElement(this.getId());) {
    if("SPAN" != el.tagName.toUpperCase()) {
      this.logger_.shout("handleNonSpanElement_:removed the id of a non-span element!"), el.removeAttribute("id")
    }else {
      break
    }
  }
  return el
};
goog.ime.dom.RichTextToken.prototype.maybeRemoveSpan_ = function $goog$ime$dom$RichTextToken$$maybeRemoveSpan_$(spanElement, opt_containsToken) {
  var m = "maybeRemoveSpan_:";
  spanElement.removeAttribute("id");
  if(!goog.ime.dom.hasCustomStyles(spanElement)) {
    this.logger_.info(m + "span:<" + spanElement.innerHTML + ">");
    this.maybeRemovePaddingString_(spanElement);
    var spanParent = spanElement.parentNode, start, end, spanIndex, startIndex, endIndex;
    opt_containsToken && (start = this.getStart(), end = this.getEnd(), spanIndex = goog.array.indexOf(spanParent.childNodes, spanElement), startIndex = goog.array.indexOf(spanElement.childNodes, start.node), endIndex = goog.array.indexOf(spanElement.childNodes, end.node));
    this.domHelper_.flattenElement(spanElement);
    opt_containsToken && (start.reset(spanParent.childNodes[spanIndex + startIndex], start.offset), end.reset(spanParent.childNodes[spanIndex + endIndex], end.offset), this.logger_.info(m + "updated token:" + this))
  }
};
goog.ime.dom.RichTextToken.prototype.maybeRemovePaddingString_ = function $goog$ime$dom$RichTextToken$$maybeRemovePaddingString_$(spanElement) {
  if(this.preserved_ && this.paddingText_ && this.originalText == this.paddingText_) {
    var node$$0 = goog.array.find(spanElement.childNodes, function(node) {
      return node.nodeType == goog.dom.NodeType.TEXT && node.nodeValue == this.paddingText_
    }, this) || goog.array.find(spanElement.childNodes, function(node) {
      return node.nodeType == goog.dom.NodeType.TEXT && goog.string.contains(node.nodeValue, this.paddingText_)
    }, this);
    if(node$$0) {
      var text = node$$0.nodeValue, pad = this.paddingText_, index = text.indexOf(pad);
      node$$0.nodeValue = text.substring(0, index) + text.substring(index + pad.length);
      goog.array.forEach([this.getStart(), this.getEnd()], function(caret) {
        node$$0 == caret.node && index < caret.offset && caret.reset(node$$0, Math.max(index, caret.offset - pad.length))
      });
      this.paddingText_ = null
    }
  }
};
goog.ime.dom.RichTextToken.prototype.cleanContentsDom_ = function $goog$ime$dom$RichTextToken$$cleanContentsDom_$(opt_updateToken) {
  var m = "cleanContentsDom_:";
  if(this.textInput.isEditable() && this.preserved_) {
    for(var tokenNotFound = !0, spanEl, spanParent;spanEl = this.getSpanElement_();) {
      spanParent = spanEl.parentNode;
      if(opt_updateToken && tokenNotFound) {
        var startCaret = this.startCaret, endCaret = this.endCaret, origText = this.originalText, origTextNodeIndex = goog.array.findIndex(spanEl.childNodes, function(child) {
          return goog.ime.dom.isTextNode(child) && 0 <= child.nodeValue.indexOf(origText)
        });
        if(0 <= origTextNodeIndex) {
          var origTextNode = spanEl.childNodes[origTextNodeIndex], startIndex = origTextNode.nodeValue.indexOf(origText), endIndex = startIndex + origText.length;
          this.logger_.info(m + "Found a match at index " + startIndex);
          startCaret.reset(origTextNode, startIndex);
          endCaret.reset(origTextNode, endIndex);
          tokenNotFound = !1;
          this.maybeRemoveSpan_(spanEl, !0)
        }
      }
      this.domHelper_.contains(spanParent, spanEl) && this.maybeRemoveSpan_(spanEl)
    }
    this.preserved_ = !1
  }
};
goog.ime.dom.RichTextToken.prototype.validate = function $goog$ime$dom$RichTextToken$$validate$() {
  var m = "validate:";
  if(this.preserved_) {
    this.cleanContentsDom_(!0)
  }else {
    var startCaret = this.startCaret, endCaret = this.endCaret;
    if(!this.domHelper_.contains(startCaret.container, startCaret.node) || !(this.domHelper_.contains(endCaret.container, endCaret.node) && this.getText() == this.originalText)) {
      this.logger_.shout(m + "unpreserved token missing, set to null"), this.reset(null, null)
    }
  }
};
goog.ime.dom.RichTextToken.prototype.replaceToken_ = function $goog$ime$dom$RichTextToken$$replaceToken_$(newContent) {
  var m = "replaceToken_:";
  if(!this.isValid()) {
    return this.logger_.shout(m + "Invalid token"), !1
  }
  var startCaret = this.startCaret, endCaret = this.endCaret, contentReplacedEvent = {type:goog.ime.dom.TransformationEventType.AFTER_REPLACE_CONTENTS, oldContent:this.getText()};
  newContent && " " == newContent.charAt(newContent.length - 1) && (newContent = newContent.slice(0, newContent.length - 1) + "\u00a0");
  if(this.isText() && goog.isString(newContent)) {
    var node = startCaret.node, text = node.nodeValue;
    node.nodeValue = text.slice(0, startCaret.offset) + newContent + text.slice(endCaret.offset);
    var newCursorPosition = startCaret.offset + newContent.length;
    endCaret.moveTo(newCursorPosition);
    this.originalText = newContent;
    this.logger_.info(m + "replaced text content:" + newContent)
  }else {
    var range = this.getRange();
    goog.isString(newContent) && (newContent = this.domHelper_.createTextNode(newContent));
    var newContentNode = range.replaceContentsWithNode(newContent), container = newContentNode.parentNode, nodeIndex = goog.array.indexOf(container.childNodes, newContentNode);
    startCaret.reset(container, nodeIndex);
    endCaret.reset(container, nodeIndex + 1);
    this.originalText = goog.string.trim(this.domHelper_.getTextContent(newContentNode));
    this.logger_.info(m + "replaced non-text content:" + newContent)
  }
  this.originalCaret = endCaret.copy();
  contentReplacedEvent.newContent = this.originalText;
  this.textInput.dispatchEvent(contentReplacedEvent);
  goog.ime.plugin.EventUtil.sendFakeKeyUp(this.textInput.getEditableElement(), goog.events.KeyCodes.SHIFT);
  return!0
};
goog.ime.dom.RichTextToken.prototype.replace = function $goog$ime$dom$RichTextToken$$replace$(newContent) {
  var m = "replace:";
  if(!this.preserved_) {
    return this.isTextChanged() ? (this.logger_.shout(m + "unpreseved:text-changed"), !1) : this.replaceToken_(newContent)
  }
  this.saveCurrentCaret_();
  this.logger_.info(m + "created caret range [" + this.textInput.getEditableElement().innerHTML + "]");
  this.validate();
  this.logger_.info(m + "validated token [" + this.textInput.getEditableElement().innerHTML + "]");
  var textReplaced = this.replaceToken_(newContent);
  this.logger_.info(m + "replaced token [" + this.textInput.getEditableElement().innerHTML + "]");
  textReplaced ? this.logger_.info(m + "text has been changed to " + newContent) : this.logger_.shout(m + "Could not find the text anywhere.");
  this.restoreCaret_();
  this.logger_.info(m + "removed caret range: [" + this.textInput.getEditableElement().innerHTML + "]");
  return textReplaced
};
goog.ime.dom.RichTextToken.prototype.placeCaret = function $goog$ime$dom$RichTextToken$$placeCaret$(after) {
  var caret = after ? this.endCaret : this.startCaret;
  if(caret.isText()) {
    this.textInput.setCaret(caret)
  }else {
    var nodeIndex = caret.offset - (after ? 1 : 0);
    if(0 <= nodeIndex && nodeIndex < caret.node.childNodes.length) {
      var contentNode = caret.node.childNodes[nodeIndex];
      contentNode && goog.editor.range.placeCursorNextTo(contentNode, !after)
    }else {
      this.textInput.setFocus()
    }
  }
};
goog.ime.dom.RichTextToken.prototype.getPosition = function $goog$ime$dom$RichTextToken$$getPosition$(opt_corner) {
  this.preserve();
  return goog.ime.positioning.getSpanPosition(this.getSpanElement_(), opt_corner)
};
goog.ime.dom.RichTextToken.createFromRange = function $goog$ime$dom$RichTextToken$createFromRange$(textInput, range) {
  var container = textInput.getEditableElement(), startCaret = new goog.ime.dom.RichTextCaret(container, range.getStartNode(), range.getStartOffset()), endCaret = new goog.ime.dom.RichTextCaret(container, range.getEndNode(), range.getEndOffset());
  return new goog.ime.dom.RichTextToken(textInput, startCaret, endCaret, range)
};
goog.ime.dom.RichTextInput = function $goog$ime$dom$RichTextInput$(element, opt_type) {
  goog.ime.dom.TextInput.call(this, element, opt_type || goog.ime.dom.InputType.RICHEDIT);
  this.usesIframe = goog.ime.dom.isIframe(element)
};
goog.inherits(goog.ime.dom.RichTextInput, goog.ime.dom.TextInput);
goog.ime.dom.RichTextInput.prototype.logger = goog.debug.Logger.getLogger("goog.ime.dom.RichTextInput");
goog.ime.dom.RichTextInput.prototype.getEditableElement = function $goog$ime$dom$RichTextInput$$getEditableElement$() {
  this.usesIframe && this.editableElement == this.containerElement && (this.editableElement = goog.dom.getFrameContentDocument(this.containerElement).body);
  return this.editableElement
};
goog.ime.dom.RichTextInput.prototype.getWindow = function $goog$ime$dom$RichTextInput$$getWindow$() {
  return this.getDomHelper().getWindow()
};
goog.ime.dom.RichTextInput.prototype.isEditable = function $goog$ime$dom$RichTextInput$$isEditable$() {
  var element = this.getEditableElement();
  if(this.usesIframe) {
    var doc = element.ownerDocument;
    if("on" == doc.designMode.toLowerCase()) {
      return!0
    }
  }
  var contentEditableValue = element.contentEditable;
  return"true" == contentEditableValue.toLowerCase() || element.isContentEditable
};
goog.ime.dom.RichTextInput.prototype.isRangeValid_ = function $goog$ime$dom$RichTextInput$$isRangeValid_$(range) {
  var editableElementRange = goog.dom.Range.createFromNodeContents(this.getEditableElement());
  return!!range && range.isRangeInDocument() && editableElementRange.containsRange(range, !0) && range.getWindow() == this.getWindow()
};
goog.ime.dom.RichTextInput.prototype.getSelectionRange = function $goog$ime$dom$RichTextInput$$getSelectionRange$() {
  var range = goog.dom.Range.createFromWindow(this.getWindow());
  return this.isRangeValid_(range) ? range : null
};
goog.ime.dom.RichTextInput.isLineBreakingNode_ = function $goog$ime$dom$RichTextInput$isLineBreakingNode_$(domNode) {
  return!(domNode && !(goog.editor.node.isBlockTag(domNode) || domNode.tagName && domNode.tagName.toUpperCase() == goog.dom.TagName.BR))
};
goog.ime.dom.RichTextInput.prototype.getAdjacentTextNode = function $goog$ime$dom$RichTextInput$$getAdjacentTextNode$(node, reversed) {
  var m = "getAdjacentTextNode:", editableElem = this.getEditableElement(), isAdjacencyBreakingNode = function $isAdjacencyBreakingNode$(n, invalidateEditableElem) {
    return!n || invalidateEditableElem && n == editableElem || goog.ime.dom.RichTextInput.isLineBreakingNode_(n)
  };
  if(isAdjacencyBreakingNode(node, !0)) {
    return this.logger.info(m + "cant find"), null
  }
  for(var prevNode;!(prevNode = reversed ? node.previousSibling : node.nextSibling);) {
    if(node = node.parentNode, isAdjacencyBreakingNode(node, !0)) {
      return this.logger.info(m + "invalid node while searching ancestors. cant find"), null
    }
  }
  node = prevNode;
  this.logger.info(m + "found prev node from an ancestor:" + node);
  for(var childNode;childNode = reversed ? node.lastChild : node.firstChild;) {
    if(isAdjacencyBreakingNode(childNode, !1)) {
      return null
    }
    node = childNode
  }
  this.logger.info(m + "found child node from prev node:" + node);
  return!goog.ime.dom.isTextNode(node) ? null : !node.nodeValue ? this.getAdjacentTextNode(node, reversed) : node
};
goog.ime.dom.RichTextInput.prototype.getEndPoint_ = function $goog$ime$dom$RichTextInput$$getEndPoint_$(range, start) {
  var m = "getEndPoint_:";
  this.logger.info(m + "find " + (start ? "start" : "end"));
  var node;
  try {
    node = start ? range.getStartNode() : range.getEndNode()
  }catch(ex) {
    return this.logger.shout("Could not find endNode/startNode"), null
  }
  this.logger.info(m + "node:" + goog.ime.dom.exposeNode(node));
  goog.asserts.assert(node.nodeType == goog.dom.NodeType.TEXT || node.nodeType == goog.dom.NodeType.ELEMENT, "End point is neither text nor element.");
  var offset = start ? range.getStartOffset() : range.getEndOffset();
  this.logger.info(m + "offset:" + offset);
  if(0 < offset && !goog.ime.dom.isTextNode(node)) {
    var childNode = node.childNodes[offset];
    if(childNode && goog.dom.browserrange.canContainRangeEndpoint(childNode)) {
      node = childNode, offset = 0
    }else {
      if(childNode = node.childNodes[offset - 1], goog.dom.browserrange.canContainRangeEndpoint(childNode)) {
        for(node = childNode;node.lastChild && goog.dom.browserrange.canContainRangeEndpoint(node.lastChild);) {
          node = node.lastChild
        }
        offset = goog.editor.node.getLength(node)
      }
    }
  }
  if(0 == offset) {
    var prevNode = this.getAdjacentTextNode(node, !0);
    if(prevNode) {
      node = prevNode, offset = prevNode.nodeValue.length
    }else {
      for(;node.firstChild && goog.dom.browserrange.canContainRangeEndpoint(node.firstChild);) {
        node = node.firstChild
      }
    }
  }
  this.logger.info(m + "end point:" + goog.ime.dom.exposeNode(node) + ":offset:" + offset);
  return new goog.ime.dom.RichTextCaret(this.getEditableElement(), node, offset)
};
goog.ime.dom.RichTextInput.prototype.getSelectionToken = function $goog$ime$dom$RichTextInput$$getSelectionToken$() {
  this.logger.info("getSelectionToken");
  var range = this.getSelectionRange();
  if(!range) {
    return null
  }
  var token;
  if(range.isCollapsed()) {
    var originalCaret = new goog.ime.dom.RichTextCaret(this.getEditableElement(), range.getStartNode(), range.getStartOffset()), startCaret = this.getEndPoint_(range, !0), node = startCaret.node, offset = startCaret.offset;
    if(goog.ime.dom.isTextNode(node)) {
      var nodeLen = node.nodeValue ? node.nodeValue.length : 0, node = goog.ime.dom.mergeAdjacentText(node, !1), offset = offset + (node.nodeValue.length - nodeLen), node = goog.ime.dom.mergeAdjacentText(node, !0);
      startCaret.reset(node, offset)
    }
    token = new goog.ime.dom.RichTextToken(this, startCaret);
    originalCaret.equals(startCaret) || this.selectToken(token)
  }else {
    token = goog.ime.dom.RichTextToken.createFromRange(this, range)
  }
  return token
};
goog.ime.dom.RichTextInput.prototype.isRangeCollapsed = function $goog$ime$dom$RichTextInput$$isRangeCollapsed$() {
  var range = this.getSelectionRange();
  return!range || range.isCollapsed()
};
goog.ime.dom.RichTextInput.prototype.setCaret = function $goog$ime$dom$RichTextInput$$setCaret$(caret) {
  if(this.isEditable()) {
    this.setFocus();
    var domNode = caret.node, offset = caret.offset;
    if(this.getDomHelper().contains(this.getEditableElement(), domNode) && !(0 > offset || offset > goog.editor.node.getLength(domNode))) {
      var range = goog.dom.Range.createCaret(domNode, offset);
      range && range.select()
    }
  }
};
goog.ime.dom.RichTextInput.prototype.selectToken = function $goog$ime$dom$RichTextInput$$selectToken$(token) {
  if(this.isEditable()) {
    var range = token.getRange();
    range && range.select()
  }
};
goog.ime.dom.RichTextInput.prototype.hasFocus = function $goog$ime$dom$RichTextInput$$hasFocus$() {
  return!!this.getSelectionRange()
};
goog.ime.dom.RichTextInput.prototype.setFocus = function $goog$ime$dom$RichTextInput$$setFocus$() {
  this.isEditable() && (this.usesIframe ? this.getWindow().focus() : this.getEditableElement().focus())
};
goog.ime.dom.RichTextInput.prototype.isRightToLeft = function $goog$ime$dom$RichTextInput$$isRightToLeft$() {
  return goog.style.isRightToLeft(this.getEditableElement())
};
goog.ime.dom.RichTextInput.prototype.getDirection = function $goog$ime$dom$RichTextInput$$getDirection$() {
  return this.isRightToLeft() ? "rtl" : "ltr"
};
goog.ime.dom.RichTextInput.prototype.setDirection = function $goog$ime$dom$RichTextInput$$setDirection$(dir) {
  var editableElement = this.getEditableElement();
  return editableElement ? (editableElement.setAttribute("dir", dir), this.lastDirection = dir, !0) : !1
};
goog.ime.dom.RichTextInput.prototype.saveUserChosenDirection_ = function $goog$ime$dom$RichTextInput$$saveUserChosenDirection_$() {
  if(this.lastDirection) {
    var curDirection = this.getDirection();
    curDirection && curDirection != this.lastDirection && (this.userChosenDirection = curDirection)
  }
};
goog.ime.dom.RichTextInput.prototype.maybeChangeDirection = function $goog$ime$dom$RichTextInput$$maybeChangeDirection$(dir) {
  this.saveUserChosenDirection_();
  this.userChosenDirection || this.setDirection(dir)
};
goog.ime.dom.RichTextInput.prototype.getDomEventTarget = function $goog$ime$dom$RichTextInput$$getDomEventTarget$() {
  return this.usesIframe ? goog.dom.getFrameContentDocument(this.containerElement) : this.getEditableElement()
};
goog.ime.plugin.lang.TranslitTransformPlugin = function $goog$ime$plugin$lang$TranslitTransformPlugin$(parser, dataSource) {
  goog.ime.plugin.TransformationPlugin.call(this);
  this.parser_ = parser;
  this.textTokenMap_ = {};
  this.boundApplyTransliteration_ = goog.bind(this.applyTransliteration_, this);
  this.dataSource_ = dataSource;
  this.staticTransliterator_ = goog.ime.plugin.lang.StaticTransliterator.getDefault();
  this.textInputStatus_ = {keyCode:-1, lastKey:-1}
};
goog.inherits(goog.ime.plugin.lang.TranslitTransformPlugin, goog.ime.plugin.TransformationPlugin);
goog.ime.plugin.lang.TranslitTransformPlugin.prototype.isSupportedInputTool = function $goog$ime$plugin$lang$TranslitTransformPlugin$$isSupportedInputTool$(inputTool) {
  return goog.array.contains(goog.ime.plugin.lang.InputMethodFeatureConfig.getInputMethodsWithTransform(), inputTool.code)
};
goog.ime.plugin.lang.TranslitTransformPlugin.prototype.logger = goog.debug.Logger.getLogger("goog.ime.plugin.lang.TranslitTransformPlugin");
goog.ime.plugin.lang.TranslitTransformPlugin.prototype.getEventTypes = function $goog$ime$plugin$lang$TranslitTransformPlugin$$getEventTypes$() {
  return[goog.events.EventType.KEYDOWN, goog.events.EventType.KEYPRESS, goog.events.EventType.KEYUP, goog.events.EventType.MOUSEDOWN]
};
goog.ime.plugin.lang.TranslitTransformPlugin.prototype.ignoreEvent_ = function $goog$ime$plugin$lang$TranslitTransformPlugin$$ignoreEvent_$(control, e) {
  return goog.ime.plugin.EventUtil.isModifierEvent(e) || !control.isRangeCollapsed() ? !0 : !1
};
goog.ime.plugin.lang.TranslitTransformPlugin.prototype.applyTransliteration_ = function $goog$ime$plugin$lang$TranslitTransformPlugin$$applyTransliteration_$(query, sync, success, suggestion) {
  var text = query.getText(), langCodePair = query.inputTool.getLanguagePair();
  this.logger.info("applyTransliteration_:" + langCodePair + " - " + text);
  this.textTokenMap_[text] && (goog.array.forEach(this.textTokenMap_[text], function(token) {
    goog.asserts.assert(!token.isDisposed());
    if(success && token) {
      var prevChar = token.getStart().getPrevChar(), nextChar = token.getEnd().getNextChar();
      if(sync || !this.parser_.isTransliteratable(langCodePair, prevChar) && !this.parser_.isTransliteratable(langCodePair, nextChar)) {
        token.replace(suggestion.acceptDefault()), sync && (this.currentTextInput instanceof goog.ime.dom.RichTextInput ? token.placeCaret(!0) : this.currentTextInput.refreshCaret())
      }
    }
    token.dispose()
  }, this), delete this.textTokenMap_[text])
};
goog.ime.plugin.lang.TranslitTransformPlugin.prototype.handleTransliteration_ = function $goog$ime$plugin$lang$TranslitTransformPlugin$$handleTransliteration_$(control, token) {
  if(!token.isText() || token.isEmpty()) {
    return this.logger.info("Discarding empty/invalid token"), !1
  }
  var langCodePair = this.currentInputTool.getLanguagePair();
  token.saveCurrentText();
  var text = token.getText(), translitQuery = new goog.ime.plugin.lang.TranslitQuery(text, langCodePair);
  this.logger.info("Requesting datasource for :<" + text + ">");
  this.textTokenMap_[text] || (this.textTokenMap_[text] = []);
  this.textTokenMap_[text].push(token);
  !1 === this.dataSource_.lookup(translitQuery, this.boundApplyTransliteration_) && (this.logger.info("Preserving node for async replace"), token.preserve());
  return!0
};
goog.ime.plugin.lang.TranslitTransformPlugin.prototype.handleKeyMapping_ = function $goog$ime$plugin$lang$TranslitTransformPlugin$$handleKeyMapping_$(e, textInput) {
  var key = String.fromCharCode(e.keyCode || e.charCode), token = textInput.getSelectionToken();
  if(!token || !token.isEmpty()) {
    return this.logger.warning("handleKeyMapping:No caret detail found:Do nothing"), !1
  }
  var langPair = this.currentInputTool.getLanguagePair(), mapping = this.staticTransliterator_.get(langPair, key);
  if(mapping) {
    token.saveCurrentText();
    var suggestion = mapping.getDefault();
    token.replace(suggestion);
    token.placeCaret(!0);
    token.dispose();
    return!0
  }
  return!1
};
goog.ime.plugin.lang.TranslitTransformPlugin.prototype.handleStaticMapping_ = function $goog$ime$plugin$lang$TranslitTransformPlugin$$handleStaticMapping_$(e, textInput, token) {
  var key = String.fromCharCode(e.keyCode || e.charCode);
  if(token.isEmpty()) {
    return!1
  }
  var precedingText = token.getText(), langPair = this.currentInputTool.getLanguagePair(), mapping = this.staticTransliterator_.get(langPair, precedingText + key);
  if(mapping) {
    token.saveCurrentText();
    var suggestion = mapping.getDefault();
    token.replace(suggestion);
    token.placeCaret(!0);
    token.dispose();
    return!0
  }
  return!1
};
goog.ime.plugin.lang.TranslitTransformPlugin.prototype.handleDelimiter_ = function $goog$ime$plugin$lang$TranslitTransformPlugin$$handleDelimiter_$(e, control, token) {
  if(token.isText()) {
    var langCodePair = this.currentInputTool.getLanguagePair();
    this.parser_.findToken(token, langCodePair);
    this.logger.info("handleDelimiter_:Found token with text:" + token.getText());
    if(this.handleStaticMapping_(e, control, token)) {
      return this.logger.info("handleDelimiter_: Static mapping handled"), !0
    }
    this.handleTransliteration_(control, token)
  }
  return this.handleKeyMapping_(e, control)
};
goog.ime.plugin.lang.TranslitTransformPlugin.prototype.handleContinuationChar_ = function $goog$ime$plugin$lang$TranslitTransformPlugin$$handleContinuationChar_$() {
  this.logger.info("handleContinuationChar_:Do nothing");
  return!1
};
goog.ime.plugin.lang.TranslitTransformPlugin.prototype.handleEventInternal = function $goog$ime$plugin$lang$TranslitTransformPlugin$$handleEventInternal$(control, e) {
  if(e.type == goog.events.EventType.MOUSEDOWN) {
    return goog.userAgent.IE && control.setFocus(), !1
  }
  if(this.ignoreEvent_(control, e)) {
    return!1
  }
  var keyEvent = goog.ime.plugin.EventUtil.generateKeyEvent(e, this.textInputStatus_);
  if(keyEvent && (keyEvent.keyCode == goog.events.KeyCodes.ENTER || keyEvent.charCode && !(keyEvent.shiftKey && keyEvent.charCode == goog.events.KeyCodes.SPACE))) {
    var langCodePair = this.currentInputTool.getLanguagePair(), ch = String.fromCharCode(keyEvent.charCode);
    if(this.parser_.isDelimiter(langCodePair, ch) || keyEvent.keyCode == goog.events.KeyCodes.ENTER) {
      var token = control.getSelectionToken();
      return!!token && this.handleDelimiter_(e, control, token)
    }
    if(this.parser_.isContinuationChar(langCodePair, ch)) {
      return this.handleContinuationChar_(control)
    }
  }
  return!1
};
goog.ime.plugin.lang.setApplicationName = function $goog$ime$plugin$lang$setApplicationName$(applicationName) {
  goog.ime.plugin.lang.TranslitQuery.applicationName = applicationName
};
goog.ime.plugin.lang.buildTranslitPlugin = function $goog$ime$plugin$lang$buildTranslitPlugin$(asyncHttpService) {
  var parser = new goog.ime.plugin.lang.TranslitParser, dataSource = new goog.ime.plugin.lang.TranslitDataSource(asyncHttpService, {"":new goog.ime.plugin.lang.DataSourceConfig({applicationCode:goog.ime.plugin.lang.ApplicationCode.API, fetchSuggestionsCount:5})}), popupeditorDatasourceConfigMap = {};
  popupeditorDatasourceConfigMap[""] = new goog.ime.plugin.lang.DataSourceConfig({applicationCode:goog.ime.plugin.lang.ApplicationCode.API, fetchSuggestionsCount:10, fetchSuggestionsInc:40, maxFetchSuggestionsCount:50});
  popupeditorDatasourceConfigMap[goog.ime.lang.LanguageCode.VIETNAMESE] = new goog.ime.plugin.lang.DataSourceConfig({applicationCode:goog.ime.plugin.lang.ApplicationCode.API, fetchSuggestionsCount:16, fetchSuggestionsInc:48, maxFetchSuggestionsCount:64});
  popupeditorDatasourceConfigMap[goog.ime.lang.LanguageCode.JAPANESE] = new goog.ime.plugin.lang.DataSourceConfig({applicationCode:goog.ime.plugin.lang.ApplicationCode.API, fetchSuggestionsCount:18, fetchSuggestionsInc:90, maxFetchSuggestionsCount:198});
  var popupeditorDataSource = new goog.ime.plugin.lang.TranslitDataSource(asyncHttpService, popupeditorDatasourceConfigMap, !0, goog.ime.plugin.lang.PrefixSuggestionItem.builder), suggestionMenuRenderer = goog.ime.plugin.lang.SuggestionMenuRenderer.getDefault(), popupEditorRenderer = goog.ime.plugin.lang.PopupEditorRenderer.getDefault(), translitPluginBuilders = [function() {
    return new goog.ime.plugin.lang.TranslitSuggestionPlugin(parser, dataSource, suggestionMenuRenderer)
  }, function() {
    return new goog.ime.plugin.lang.TranslitTransformPlugin(parser, dataSource)
  }, function() {
    return new goog.ime.plugin.lang.PopupEditorPlugin(popupeditorDataSource, popupEditorRenderer)
  }, function() {
    return new goog.ime.plugin.keyboard.KeyboardPlugin
  }], translitPlugin = new goog.ime.plugin.lang.CompositeTranslitPlugin(translitPluginBuilders);
  return translitPlugin
};
goog.dom.selection = {};
goog.dom.selection.setStart = function $goog$dom$selection$setStart$(textfield, pos) {
  if(goog.dom.selection.useSelectionProperties_(textfield)) {
    textfield.selectionStart = pos
  }else {
    if(goog.userAgent.IE) {
      var tmp = goog.dom.selection.getRangeIe_(textfield), range = tmp[0], selectionRange = tmp[1];
      range.inRange(selectionRange) && (pos = goog.dom.selection.canonicalizePositionIe_(textfield, pos), range.collapse(!0), range.move("character", pos), range.select())
    }
  }
};
goog.dom.selection.getStart = function $goog$dom$selection$getStart$(textfield) {
  return goog.dom.selection.getEndPoints_(textfield, !0)[0]
};
goog.dom.selection.getEndPointsTextareaIe_ = function $goog$dom$selection$getEndPointsTextareaIe_$(range, selRange, getOnlyStart) {
  for(var selectionRange = selRange.duplicate(), beforeSelectionText = range.text, untrimmedBeforeSelectionText = beforeSelectionText, selectionText = selectionRange.text, untrimmedSelectionText = selectionText, isRangeEndTrimmed = !1;!isRangeEndTrimmed;) {
    0 == range.compareEndPoints("StartToEnd", range) ? isRangeEndTrimmed = !0 : (range.moveEnd("character", -1), range.text == beforeSelectionText ? untrimmedBeforeSelectionText += "\r\n" : isRangeEndTrimmed = !0)
  }
  if(getOnlyStart) {
    return[untrimmedBeforeSelectionText.length, -1]
  }
  for(var isSelectionRangeEndTrimmed = !1;!isSelectionRangeEndTrimmed;) {
    0 == selectionRange.compareEndPoints("StartToEnd", selectionRange) ? isSelectionRangeEndTrimmed = !0 : (selectionRange.moveEnd("character", -1), selectionRange.text == selectionText ? untrimmedSelectionText += "\r\n" : isSelectionRangeEndTrimmed = !0)
  }
  return[untrimmedBeforeSelectionText.length, untrimmedBeforeSelectionText.length + untrimmedSelectionText.length]
};
goog.dom.selection.getEndPoints = function $goog$dom$selection$getEndPoints$(textfield) {
  return goog.dom.selection.getEndPoints_(textfield, !1)
};
goog.dom.selection.getEndPoints_ = function $goog$dom$selection$getEndPoints_$(textfield, getOnlyStart) {
  var startPos = 0, endPos = 0;
  if(goog.dom.selection.useSelectionProperties_(textfield)) {
    startPos = textfield.selectionStart, endPos = getOnlyStart ? -1 : textfield.selectionEnd
  }else {
    if(goog.userAgent.IE) {
      var tmp = goog.dom.selection.getRangeIe_(textfield), range = tmp[0], selectionRange = tmp[1];
      if(range.inRange(selectionRange)) {
        range.setEndPoint("EndToStart", selectionRange);
        if("textarea" == textfield.type) {
          return goog.dom.selection.getEndPointsTextareaIe_(range, selectionRange, getOnlyStart)
        }
        startPos = range.text.length;
        endPos = getOnlyStart ? -1 : range.text.length + selectionRange.text.length
      }
    }
  }
  return[startPos, endPos]
};
goog.dom.selection.setEnd = function $goog$dom$selection$setEnd$(textfield, pos) {
  if(goog.dom.selection.useSelectionProperties_(textfield)) {
    textfield.selectionEnd = pos
  }else {
    if(goog.userAgent.IE) {
      var tmp = goog.dom.selection.getRangeIe_(textfield), range = tmp[0], selectionRange = tmp[1];
      if(range.inRange(selectionRange)) {
        var pos = goog.dom.selection.canonicalizePositionIe_(textfield, pos), startCursorPos = goog.dom.selection.canonicalizePositionIe_(textfield, goog.dom.selection.getStart(textfield));
        selectionRange.collapse(!0);
        selectionRange.moveEnd("character", pos - startCursorPos);
        selectionRange.select()
      }
    }
  }
};
goog.dom.selection.getEnd = function $goog$dom$selection$getEnd$(textfield) {
  return goog.dom.selection.getEndPoints_(textfield, !1)[1]
};
goog.dom.selection.setCursorPosition = function $goog$dom$selection$setCursorPosition$(textfield, pos) {
  if(goog.dom.selection.useSelectionProperties_(textfield)) {
    textfield.selectionStart = pos, textfield.selectionEnd = pos
  }else {
    if(goog.userAgent.IE) {
      var pos = goog.dom.selection.canonicalizePositionIe_(textfield, pos), sel = textfield.createTextRange();
      sel.collapse(!0);
      sel.move("character", pos);
      sel.select()
    }
  }
};
goog.dom.selection.setText = function $goog$dom$selection$setText$(textfield, text) {
  if(goog.dom.selection.useSelectionProperties_(textfield)) {
    var value = textfield.value, oldSelectionStart = textfield.selectionStart, before = value.substr(0, oldSelectionStart), after = value.substr(textfield.selectionEnd);
    textfield.value = before + text + after;
    textfield.selectionStart = oldSelectionStart;
    textfield.selectionEnd = oldSelectionStart + text.length
  }else {
    if(goog.userAgent.IE) {
      var tmp = goog.dom.selection.getRangeIe_(textfield), range = tmp[0], selectionRange = tmp[1];
      if(range.inRange(selectionRange)) {
        var range2 = selectionRange.duplicate();
        selectionRange.text = text;
        selectionRange.setEndPoint("StartToStart", range2);
        selectionRange.select()
      }
    }else {
      throw Error("Cannot set the selection end");
    }
  }
};
goog.dom.selection.getText = function $goog$dom$selection$getText$(textfield) {
  if(goog.dom.selection.useSelectionProperties_(textfield)) {
    var s = textfield.value;
    return s.substring(textfield.selectionStart, textfield.selectionEnd)
  }
  if(goog.userAgent.IE) {
    var tmp = goog.dom.selection.getRangeIe_(textfield), range = tmp[0], selectionRange = tmp[1];
    if(range.inRange(selectionRange)) {
      if("textarea" == textfield.type) {
        return goog.dom.selection.getSelectionRangeText_(selectionRange)
      }
    }else {
      return""
    }
    return selectionRange.text
  }
  throw Error("Cannot get the selection text");
};
goog.dom.selection.getSelectionRangeText_ = function $goog$dom$selection$getSelectionRangeText_$(selRange) {
  for(var selectionRange = selRange.duplicate(), selectionText = selectionRange.text, untrimmedSelectionText = selectionText, isSelectionRangeEndTrimmed = !1;!isSelectionRangeEndTrimmed;) {
    0 == selectionRange.compareEndPoints("StartToEnd", selectionRange) ? isSelectionRangeEndTrimmed = !0 : (selectionRange.moveEnd("character", -1), selectionRange.text == selectionText ? untrimmedSelectionText += "\r\n" : isSelectionRangeEndTrimmed = !0)
  }
  return untrimmedSelectionText
};
goog.dom.selection.getRangeIe_ = function $goog$dom$selection$getRangeIe_$(el) {
  var doc = el.ownerDocument || el.document, selectionRange = doc.selection.createRange(), range;
  "textarea" == el.type ? (range = doc.body.createTextRange(), range.moveToElementText(el)) : range = el.createTextRange();
  return[range, selectionRange]
};
goog.dom.selection.canonicalizePositionIe_ = function $goog$dom$selection$canonicalizePositionIe_$(textfield, pos) {
  if("textarea" == textfield.type) {
    var value = textfield.value.substring(0, pos), pos = goog.string.canonicalizeNewlines(value).length
  }
  return pos
};
goog.dom.selection.useSelectionProperties_ = function $goog$dom$selection$useSelectionProperties_$(el) {
  try {
    return"number" == typeof el.selectionStart
  }catch(e) {
    return!1
  }
};
goog.ime.dom.PlainTextCaret = function $goog$ime$dom$PlainTextCaret$(container, offset) {
  goog.ime.dom.Caret.call(this, container, offset)
};
goog.inherits(goog.ime.dom.PlainTextCaret, goog.ime.dom.Caret);
goog.ime.dom.PlainTextCaret.prototype.copy = function $goog$ime$dom$PlainTextCaret$$copy$() {
  return new goog.ime.dom.PlainTextCaret(this.container, this.offset)
};
goog.ime.dom.PlainTextCaret.prototype.isText = goog.functions.TRUE;
goog.ime.dom.PlainTextCaret.prototype.getAdjacentText = function $goog$ime$dom$PlainTextCaret$$getAdjacentText$() {
  return this.container.value || ""
};
goog.ime.dom.PlainTextCaret.prototype.isValid = function $goog$ime$dom$PlainTextCaret$$isValid$() {
  return!!this.container.ownerDocument && !!this.container.parentNode && 0 <= this.offset && this.offset <= this.getAdjacentText().length
};
goog.ime.dom.PlainTextCaret.prototype.moveTo = function $goog$ime$dom$PlainTextCaret$$moveTo$(newOffset) {
  var adjacentText = this.getAdjacentText(), adjacentTextLength = adjacentText.length;
  newOffset <= adjacentTextLength && 0 <= newOffset && (this.offset = newOffset);
  return this
};
goog.ime.dom.PlainTextCaret.prototype.getBeforeFixText = function $goog$ime$dom$PlainTextCaret$$getBeforeFixText$(opt_length) {
  var text = this.container.value;
  text && (text = opt_length && this.offset > opt_length ? text.substring(this.offset - opt_length, this.offset) : text.substring(0, this.offset));
  return text
};
goog.ime.dom.PlainTextToken = function $goog$ime$dom$PlainTextToken$(textInput, startCaret, opt_endCaret) {
  goog.ime.dom.Token.call(this, textInput, startCaret, opt_endCaret)
};
goog.inherits(goog.ime.dom.PlainTextToken, goog.ime.dom.Token);
goog.ime.dom.PlainTextToken.prototype.logger_ = goog.debug.Logger.getLogger("goog.ime.dom.PlainTextToken");
goog.ime.dom.PlainTextToken.prototype.disposeInternal = function $goog$ime$dom$PlainTextToken$$disposeInternal$() {
  this.textInput.unregisterToken(this)
};
goog.ime.dom.PlainTextToken.prototype.isText = goog.functions.TRUE;
goog.ime.dom.PlainTextToken.prototype.preserve = function $goog$ime$dom$PlainTextToken$$preserve$() {
  this.textInput.registerToken(this)
};
goog.ime.dom.PlainTextToken.prototype.replace = function $goog$ime$dom$PlainTextToken$$replace$(newContent) {
  if(!goog.isString(newContent)) {
    return!1
  }
  if(this.getText() == newContent) {
    return!0
  }
  if(this.isTextChanged()) {
    return!1
  }
  var textInputEl = this.textInput.getEditableElement(), caretPos = goog.dom.selection.getEnd(textInputEl), contentReplacedEvent = {type:goog.ime.dom.TransformationEventType.AFTER_REPLACE_CONTENTS, oldContent:this.originalText}, scrollTop = textInputEl.scrollTop, start = this.startCaret, end = this.endCaret, beforeText = start.getBeforeText(), afterText = end.getAfterText();
  textInputEl.value = beforeText + newContent + afterText;
  var newEndOffset = start.offset + newContent.length;
  caretPos >= end.offset ? caretPos += newContent.length - this.originalText.length : caretPos > start.offset && (caretPos = newEndOffset);
  if(newEndOffset != end.offset) {
    var delta = newEndOffset - end.offset;
    this.textInput.processTokens(function(token) {
      token.getStart().offset >= end.offset && token.move(delta)
    })
  }
  end.moveTo(newEndOffset);
  this.originalCaret && this.originalCaret.moveTo(caretPos);
  if(this.textInput.hasFocus()) {
    var newCaret = end.copy();
    newCaret.moveTo(caretPos);
    this.textInput.setCaret(newCaret);
    this.logger_.info("Caret moved to:" + caretPos)
  }
  textInputEl.scrollTop = scrollTop;
  contentReplacedEvent.newContent = this.originalText = newContent;
  this.textInput.dispatchEvent(contentReplacedEvent);
  goog.ime.plugin.EventUtil.sendFakeKeyUp(this.textInput.getEditableElement(), goog.events.KeyCodes.SHIFT);
  return!0
};
goog.ime.dom.PlainTextToken.prototype.placeCaret = function $goog$ime$dom$PlainTextToken$$placeCaret$(after) {
  var caret = after ? this.endCaret : this.startCaret;
  this.textInput.setCaret(caret)
};
goog.ime.dom.PlainTextToken.prototype.getPosition = function $goog$ime$dom$PlainTextToken$$getPosition$(opt_corner, opt_isFixOffset) {
  return goog.ime.positioning.getTextPosition(this.startCaret, this.endCaret, opt_corner, opt_isFixOffset)
};
goog.ime.dom.PlainTextInput = function $goog$ime$dom$PlainTextInput$(opt_element) {
  var element = opt_element ? opt_element : goog.dom.createDom("input", {type:"text", style:"visibility:hidden"});
  goog.ime.dom.TextInput.call(this, element, goog.ime.dom.InputType.TEXTEDIT)
};
goog.inherits(goog.ime.dom.PlainTextInput, goog.ime.dom.TextInput);
goog.ime.dom.PlainTextInput.prototype.logger = goog.debug.Logger.getLogger("goog.ime.dom.PlainTextInput");
goog.ime.dom.PlainTextInput.prototype.getSelectionToken = function $goog$ime$dom$PlainTextInput$$getSelectionToken$() {
  var endPoints = goog.dom.selection.getEndPoints(this.editableElement), startCaret = new goog.ime.dom.PlainTextCaret(this.editableElement, endPoints[0]), endCaret = new goog.ime.dom.PlainTextCaret(this.editableElement, endPoints[1]);
  return new goog.ime.dom.PlainTextToken(this, startCaret, endCaret)
};
goog.ime.dom.PlainTextInput.prototype.isRangeCollapsed = function $goog$ime$dom$PlainTextInput$$isRangeCollapsed$() {
  var endpoints = goog.dom.selection.getEndPoints(this.editableElement);
  return endpoints[0] == endpoints[1]
};
goog.ime.dom.PlainTextInput.prototype.setCaret = function $goog$ime$dom$PlainTextInput$$setCaret$(caret) {
  goog.dom.selection.setCursorPosition(this.editableElement, caret.offset);
  goog.userAgent.GECKO && this.setFocus()
};
goog.ime.dom.PlainTextInput.prototype.selectToken = function $goog$ime$dom$PlainTextInput$$selectToken$(token) {
  var startOffset = token.getStart().offset, endOffset = token.getEnd().offset;
  goog.dom.selection.setStart(this.editableElement, startOffset);
  goog.dom.selection.setEnd(this.editableElement, endOffset);
  this.setFocus()
};
goog.ime.dom.PlainTextInput.prototype.isEditable = function $goog$ime$dom$PlainTextInput$$isEditable$() {
  return!!this.editableElement.disabled
};
goog.ime.dom.PlainTextInput.prototype.hasFocus = function $goog$ime$dom$PlainTextInput$$hasFocus$() {
  return this.editableElement == this.getDomHelper().getDocument().activeElement
};
goog.ime.dom.PlainTextInput.prototype.setFocus = function $goog$ime$dom$PlainTextInput$$setFocus$() {
  this.editableElement.focus()
};
goog.ime.dom.PlainTextInput.prototype.isRightToLeft = function $goog$ime$dom$PlainTextInput$$isRightToLeft$() {
  return goog.style.isRightToLeft(this.editableElement)
};
goog.ime.dom.PlainTextInput.prototype.getDirection = function $goog$ime$dom$PlainTextInput$$getDirection$() {
  return this.isRightToLeft() ? "rtl" : "ltr"
};
goog.ime.dom.PlainTextInput.prototype.setDirection = function $goog$ime$dom$PlainTextInput$$setDirection$(dir) {
  this.editableElement.setAttribute("dir", dir);
  return!0
};
goog.ime.dom.PlainTextInput.prototype.maybeChangeDirection = function $goog$ime$dom$PlainTextInput$$maybeChangeDirection$(dir) {
  var originalDir = this.editableElement.getAttribute("dir");
  (!originalDir || originalDir != dir) && this.setDirection(dir)
};
goog.ime.dom.PlainTextInput.prototype.refreshCaret = function $goog$ime$dom$PlainTextInput$$refreshCaret$() {
  var ele = this.getEditableElement();
  if(goog.userAgent.GECKO && 4 > parseFloat(goog.userAgent.VERSION)) {
    var evt = document.createEvent("KeyEvents");
    evt.initKeyEvent(goog.events.EventType.KEYPRESS, !0, !0, window, !1, !1, !1, !1, 0, goog.events.KeyCodes.SPACE);
    ele.dispatchEvent(evt);
    evt = document.createEvent("KeyEvents");
    evt.initKeyEvent(goog.events.EventType.KEYPRESS, !0, !0, window, !1, !1, !1, !1, goog.events.KeyCodes.BACKSPACE, 0);
    ele.dispatchEvent(evt)
  }else {
    goog.userAgent.WEBKIT && !this.isDelegation && (ele.blur(), this.setFocus())
  }
};
goog.ime.api.ita.DomManager = function $goog$ime$api$ita$DomManager$() {
  this.textInputs_ = {}
};
goog.inherits(goog.ime.api.ita.DomManager, goog.Disposable);
goog.ime.api.ita.DomManager.prototype.getOrCreateTextInput = function $goog$ime$api$ita$DomManager$$getOrCreateTextInput$(element) {
  if(element.commitText) {
    var inputable = element, uid = goog.getUid(inputable).toString();
    if(!this.textInputs_[uid]) {
      var textInput = new goog.ime.dom.TextInput(inputable, goog.ime.dom.InputType.CUSTOMIZED);
      this.textInputs_[uid] = textInput
    }
  }else {
    var elem = goog.dom.getElement(element);
    if(!elem) {
      return null
    }
    uid = goog.getUid(elem).toString();
    this.textInputs_[uid] || (textInput = this.isRichedit_(elem) ? new goog.ime.dom.RichTextInput(elem) : new goog.ime.dom.PlainTextInput(elem), this.textInputs_[uid] = textInput)
  }
  return this.textInputs_[uid]
};
goog.ime.api.ita.DomManager.prototype.isRichedit_ = function $goog$ime$api$ita$DomManager$$isRichedit_$(element) {
  var tagName = element.tagName.toUpperCase();
  return tagName == goog.dom.TagName.IFRAME || tagName == goog.dom.TagName.DIV
};
goog.ime.api.ita.DomManager.prototype.disposeInternal = function $goog$ime$api$ita$DomManager$$disposeInternal$() {
  goog.ime.api.ita.DomManager.superClass_.disposeInternal.call(this);
  goog.object.forEach(this.textInputs_, function(textInput) {
    textInput && textInput.dispose()
  });
  this.textInputs_ = null
};
goog.uri = {};
goog.uri.utils = {};
goog.uri.utils.CharCode_ = {AMPERSAND:38, EQUAL:61, HASH:35, QUESTION:63};
goog.uri.utils.buildFromEncodedParts = function $goog$uri$utils$buildFromEncodedParts$(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) {
  var out = [];
  opt_scheme && out.push(opt_scheme, ":");
  opt_domain && (out.push("//"), opt_userInfo && out.push(opt_userInfo, "@"), out.push(opt_domain), opt_port && out.push(":", opt_port));
  opt_path && out.push(opt_path);
  opt_queryData && out.push("?", opt_queryData);
  opt_fragment && out.push("#", opt_fragment);
  return out.join("")
};
goog.uri.utils.splitRe_ = RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([\\w\\d\\-\\u0100-\\uffff.%]*)(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");
goog.uri.utils.ComponentIndex = {SCHEME:1, USER_INFO:2, DOMAIN:3, PORT:4, PATH:5, QUERY_DATA:6, FRAGMENT:7};
goog.uri.utils.split = function $goog$uri$utils$split$(uri) {
  goog.uri.utils.phishingProtection_();
  return uri.match(goog.uri.utils.splitRe_)
};
goog.uri.utils.needsPhishingProtection_ = goog.userAgent.WEBKIT;
goog.uri.utils.phishingProtection_ = function $goog$uri$utils$phishingProtection_$() {
  if(goog.uri.utils.needsPhishingProtection_) {
    goog.uri.utils.needsPhishingProtection_ = !1;
    var location = goog.global.location;
    if(location) {
      var href = location.href;
      if(href) {
        var domain = goog.uri.utils.getDomain(href);
        if(domain && domain != location.hostname) {
          throw goog.uri.utils.needsPhishingProtection_ = !0, Error();
        }
      }
    }
  }
};
goog.uri.utils.decodeIfPossible_ = function $goog$uri$utils$decodeIfPossible_$(uri) {
  return uri && decodeURIComponent(uri)
};
goog.uri.utils.getComponentByIndex_ = function $goog$uri$utils$getComponentByIndex_$(componentIndex, uri) {
  return goog.uri.utils.split(uri)[componentIndex] || null
};
goog.uri.utils.getScheme = function $goog$uri$utils$getScheme$(uri) {
  return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.SCHEME, uri)
};
goog.uri.utils.getEffectiveScheme = function $goog$uri$utils$getEffectiveScheme$(uri) {
  var scheme = goog.uri.utils.getScheme(uri);
  if(!scheme && self.location) {
    var protocol = self.location.protocol, scheme = protocol.substr(0, protocol.length - 1)
  }
  return scheme ? scheme.toLowerCase() : ""
};
goog.uri.utils.getUserInfoEncoded = function $goog$uri$utils$getUserInfoEncoded$(uri) {
  return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.USER_INFO, uri)
};
goog.uri.utils.getUserInfo = function $goog$uri$utils$getUserInfo$(uri) {
  return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getUserInfoEncoded(uri))
};
goog.uri.utils.getDomainEncoded = function $goog$uri$utils$getDomainEncoded$(uri) {
  return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.DOMAIN, uri)
};
goog.uri.utils.getDomain = function $goog$uri$utils$getDomain$(uri) {
  return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getDomainEncoded(uri))
};
goog.uri.utils.getPort = function $goog$uri$utils$getPort$(uri) {
  return Number(goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PORT, uri)) || null
};
goog.uri.utils.getPathEncoded = function $goog$uri$utils$getPathEncoded$(uri) {
  return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PATH, uri)
};
goog.uri.utils.getPath = function $goog$uri$utils$getPath$(uri) {
  return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getPathEncoded(uri))
};
goog.uri.utils.getQueryData = function $goog$uri$utils$getQueryData$(uri) {
  return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.QUERY_DATA, uri)
};
goog.uri.utils.getFragmentEncoded = function $goog$uri$utils$getFragmentEncoded$(uri) {
  var hashIndex = uri.indexOf("#");
  return 0 > hashIndex ? null : uri.substr(hashIndex + 1)
};
goog.uri.utils.setFragmentEncoded = function $goog$uri$utils$setFragmentEncoded$(uri, fragment) {
  return goog.uri.utils.removeFragment(uri) + (fragment ? "#" + fragment : "")
};
goog.uri.utils.getFragment = function $goog$uri$utils$getFragment$(uri) {
  return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getFragmentEncoded(uri))
};
goog.uri.utils.getHost = function $goog$uri$utils$getHost$(uri) {
  var pieces = goog.uri.utils.split(uri);
  return goog.uri.utils.buildFromEncodedParts(pieces[goog.uri.utils.ComponentIndex.SCHEME], pieces[goog.uri.utils.ComponentIndex.USER_INFO], pieces[goog.uri.utils.ComponentIndex.DOMAIN], pieces[goog.uri.utils.ComponentIndex.PORT])
};
goog.uri.utils.getPathAndAfter = function $goog$uri$utils$getPathAndAfter$(uri) {
  var pieces = goog.uri.utils.split(uri);
  return goog.uri.utils.buildFromEncodedParts(null, null, null, null, pieces[goog.uri.utils.ComponentIndex.PATH], pieces[goog.uri.utils.ComponentIndex.QUERY_DATA], pieces[goog.uri.utils.ComponentIndex.FRAGMENT])
};
goog.uri.utils.removeFragment = function $goog$uri$utils$removeFragment$(uri) {
  var hashIndex = uri.indexOf("#");
  return 0 > hashIndex ? uri : uri.substr(0, hashIndex)
};
goog.uri.utils.haveSameDomain = function $goog$uri$utils$haveSameDomain$(uri1, uri2) {
  var pieces1 = goog.uri.utils.split(uri1), pieces2 = goog.uri.utils.split(uri2);
  return pieces1[goog.uri.utils.ComponentIndex.DOMAIN] == pieces2[goog.uri.utils.ComponentIndex.DOMAIN] && pieces1[goog.uri.utils.ComponentIndex.SCHEME] == pieces2[goog.uri.utils.ComponentIndex.SCHEME] && pieces1[goog.uri.utils.ComponentIndex.PORT] == pieces2[goog.uri.utils.ComponentIndex.PORT]
};
goog.uri.utils.assertNoFragmentsOrQueries_ = function $goog$uri$utils$assertNoFragmentsOrQueries_$(uri) {
  if(goog.DEBUG && (0 <= uri.indexOf("#") || 0 <= uri.indexOf("?"))) {
    throw Error("goog.uri.utils: Fragment or query identifiers are not supported: [" + uri + "]");
  }
};
goog.uri.utils.appendQueryData_ = function $goog$uri$utils$appendQueryData_$(buffer) {
  if(buffer[1]) {
    var baseUri = buffer[0], hashIndex = baseUri.indexOf("#");
    0 <= hashIndex && (buffer.push(baseUri.substr(hashIndex)), buffer[0] = baseUri = baseUri.substr(0, hashIndex));
    var questionIndex = baseUri.indexOf("?");
    0 > questionIndex ? buffer[1] = "?" : questionIndex == baseUri.length - 1 && (buffer[1] = void 0)
  }
  return buffer.join("")
};
goog.uri.utils.appendKeyValuePairs_ = function $goog$uri$utils$appendKeyValuePairs_$(key, value, pairs) {
  if(goog.isArray(value)) {
    for(var j = 0;j < value.length;j++) {
      pairs.push("&", key), "" !== value[j] && pairs.push("=", goog.string.urlEncode(value[j]))
    }
  }else {
    null != value && (pairs.push("&", key), "" !== value && pairs.push("=", goog.string.urlEncode(value)))
  }
};
goog.uri.utils.buildQueryDataBuffer_ = function $goog$uri$utils$buildQueryDataBuffer_$(buffer, keysAndValues, opt_startIndex) {
  goog.asserts.assert(0 == Math.max(keysAndValues.length - (opt_startIndex || 0), 0) % 2, "goog.uri.utils: Key/value lists must be even in length.");
  for(var i = opt_startIndex || 0;i < keysAndValues.length;i += 2) {
    goog.uri.utils.appendKeyValuePairs_(keysAndValues[i], keysAndValues[i + 1], buffer)
  }
  return buffer
};
goog.uri.utils.buildQueryData = function $goog$uri$utils$buildQueryData$(keysAndValues, opt_startIndex) {
  var buffer = goog.uri.utils.buildQueryDataBuffer_([], keysAndValues, opt_startIndex);
  buffer[0] = "";
  return buffer.join("")
};
goog.uri.utils.buildQueryDataBufferFromMap_ = function $goog$uri$utils$buildQueryDataBufferFromMap_$(buffer, map) {
  for(var key in map) {
    goog.uri.utils.appendKeyValuePairs_(key, map[key], buffer)
  }
  return buffer
};
goog.uri.utils.buildQueryDataFromMap = function $goog$uri$utils$buildQueryDataFromMap$(map) {
  var buffer = goog.uri.utils.buildQueryDataBufferFromMap_([], map);
  buffer[0] = "";
  return buffer.join("")
};
goog.uri.utils.appendParams = function $goog$uri$utils$appendParams$(uri, var_args) {
  return goog.uri.utils.appendQueryData_(2 == arguments.length ? goog.uri.utils.buildQueryDataBuffer_([uri], arguments[1], 0) : goog.uri.utils.buildQueryDataBuffer_([uri], arguments, 1))
};
goog.uri.utils.appendParamsFromMap = function $goog$uri$utils$appendParamsFromMap$(uri, map) {
  return goog.uri.utils.appendQueryData_(goog.uri.utils.buildQueryDataBufferFromMap_([uri], map))
};
goog.uri.utils.appendParam = function $goog$uri$utils$appendParam$(uri, key, value) {
  return goog.uri.utils.appendQueryData_([uri, "&", key, "=", goog.string.urlEncode(value)])
};
goog.uri.utils.findParam_ = function $goog$uri$utils$findParam_$(uri, startIndex, keyEncoded, hashOrEndIndex) {
  for(var index = startIndex, keyLength = keyEncoded.length;0 <= (index = uri.indexOf(keyEncoded, index)) && index < hashOrEndIndex;) {
    var precedingChar = uri.charCodeAt(index - 1);
    if(precedingChar == goog.uri.utils.CharCode_.AMPERSAND || precedingChar == goog.uri.utils.CharCode_.QUESTION) {
      var followingChar = uri.charCodeAt(index + keyLength);
      if(!followingChar || followingChar == goog.uri.utils.CharCode_.EQUAL || followingChar == goog.uri.utils.CharCode_.AMPERSAND || followingChar == goog.uri.utils.CharCode_.HASH) {
        return index
      }
    }
    index += keyLength + 1
  }
  return-1
};
goog.uri.utils.hashOrEndRe_ = /#|$/;
goog.uri.utils.hasParam = function $goog$uri$utils$hasParam$(uri, keyEncoded) {
  return 0 <= goog.uri.utils.findParam_(uri, 0, keyEncoded, uri.search(goog.uri.utils.hashOrEndRe_))
};
goog.uri.utils.getParamValue = function $goog$uri$utils$getParamValue$(uri, keyEncoded) {
  var hashOrEndIndex = uri.search(goog.uri.utils.hashOrEndRe_), foundIndex = goog.uri.utils.findParam_(uri, 0, keyEncoded, hashOrEndIndex);
  if(0 > foundIndex) {
    return null
  }
  var endPosition = uri.indexOf("&", foundIndex);
  if(0 > endPosition || endPosition > hashOrEndIndex) {
    endPosition = hashOrEndIndex
  }
  foundIndex += keyEncoded.length + 1;
  return goog.string.urlDecode(uri.substr(foundIndex, endPosition - foundIndex))
};
goog.uri.utils.getParamValues = function $goog$uri$utils$getParamValues$(uri, keyEncoded) {
  for(var hashOrEndIndex = uri.search(goog.uri.utils.hashOrEndRe_), position = 0, foundIndex, result = [];0 <= (foundIndex = goog.uri.utils.findParam_(uri, position, keyEncoded, hashOrEndIndex));) {
    position = uri.indexOf("&", foundIndex);
    if(0 > position || position > hashOrEndIndex) {
      position = hashOrEndIndex
    }
    foundIndex += keyEncoded.length + 1;
    result.push(goog.string.urlDecode(uri.substr(foundIndex, position - foundIndex)))
  }
  return result
};
goog.uri.utils.trailingQueryPunctuationRe_ = /[?&]($|#)/;
goog.uri.utils.removeParam = function $goog$uri$utils$removeParam$(uri, keyEncoded) {
  for(var hashOrEndIndex = uri.search(goog.uri.utils.hashOrEndRe_), position = 0, foundIndex, buffer = [];0 <= (foundIndex = goog.uri.utils.findParam_(uri, position, keyEncoded, hashOrEndIndex));) {
    buffer.push(uri.substring(position, foundIndex)), position = Math.min(uri.indexOf("&", foundIndex) + 1 || hashOrEndIndex, hashOrEndIndex)
  }
  buffer.push(uri.substr(position));
  return buffer.join("").replace(goog.uri.utils.trailingQueryPunctuationRe_, "$1")
};
goog.uri.utils.setParam = function $goog$uri$utils$setParam$(uri, keyEncoded, value) {
  return goog.uri.utils.appendParam(goog.uri.utils.removeParam(uri, keyEncoded), keyEncoded, value)
};
goog.uri.utils.appendPath = function $goog$uri$utils$appendPath$(baseUri, path) {
  goog.uri.utils.assertNoFragmentsOrQueries_(baseUri);
  goog.string.endsWith(baseUri, "/") && (baseUri = baseUri.substr(0, baseUri.length - 1));
  goog.string.startsWith(path, "/") && (path = path.substr(1));
  return goog.string.buildString(baseUri, "/", path)
};
goog.uri.utils.StandardQueryParam = {RANDOM:"zx"};
goog.uri.utils.makeUnique = function $goog$uri$utils$makeUnique$(uri) {
  return goog.uri.utils.setParam(uri, goog.uri.utils.StandardQueryParam.RANDOM, goog.string.getRandomString())
};
goog.Uri = function $goog$Uri$(opt_uri, opt_ignoreCase) {
  var m;
  opt_uri instanceof goog.Uri ? (this.setIgnoreCase(null == opt_ignoreCase ? opt_uri.getIgnoreCase() : opt_ignoreCase), this.setScheme(opt_uri.getScheme()), this.setUserInfo(opt_uri.getUserInfo()), this.setDomain(opt_uri.getDomain()), this.setPort(opt_uri.getPort()), this.setPath(opt_uri.getPath()), this.setQueryData(opt_uri.getQueryData().clone()), this.setFragment(opt_uri.getFragment())) : opt_uri && (m = goog.uri.utils.split("" + opt_uri)) ? (this.setIgnoreCase(!!opt_ignoreCase), this.setScheme(m[goog.uri.utils.ComponentIndex.SCHEME] || 
  "", !0), this.setUserInfo(m[goog.uri.utils.ComponentIndex.USER_INFO] || "", !0), this.setDomain(m[goog.uri.utils.ComponentIndex.DOMAIN] || "", !0), this.setPort(m[goog.uri.utils.ComponentIndex.PORT]), this.setPath(m[goog.uri.utils.ComponentIndex.PATH] || "", !0), this.setQuery(m[goog.uri.utils.ComponentIndex.QUERY_DATA] || "", !0), this.setFragment(m[goog.uri.utils.ComponentIndex.FRAGMENT] || "", !0)) : (this.setIgnoreCase(!!opt_ignoreCase), this.queryData_ = new goog.Uri.QueryData(null, this, 
  this.ignoreCase_))
};
goog.Uri.RANDOM_PARAM = goog.uri.utils.StandardQueryParam.RANDOM;
goog.Uri.prototype.scheme_ = "";
goog.Uri.prototype.userInfo_ = "";
goog.Uri.prototype.domain_ = "";
goog.Uri.prototype.port_ = null;
goog.Uri.prototype.path_ = "";
goog.Uri.prototype.fragment_ = "";
goog.Uri.prototype.isReadOnly_ = !1;
goog.Uri.prototype.ignoreCase_ = !1;
goog.Uri.prototype.toString = function $goog$Uri$$toString$() {
  if(this.cachedToString_) {
    return this.cachedToString_
  }
  var out = [];
  this.scheme_ && out.push(goog.Uri.encodeSpecialChars_(this.scheme_, goog.Uri.reDisallowedInSchemeOrUserInfo_), ":");
  this.domain_ && (out.push("//"), this.userInfo_ && out.push(goog.Uri.encodeSpecialChars_(this.userInfo_, goog.Uri.reDisallowedInSchemeOrUserInfo_), "@"), out.push(goog.Uri.encodeString_(this.domain_)), null != this.port_ && out.push(":", "" + this.getPort()));
  this.path_ && (this.hasDomain() && "/" != this.path_.charAt(0) && out.push("/"), out.push(goog.Uri.encodeSpecialChars_(this.path_, "/" == this.path_.charAt(0) ? goog.Uri.reDisallowedInAbsolutePath_ : goog.Uri.reDisallowedInRelativePath_)));
  var query = "" + this.queryData_;
  query && out.push("?", query);
  this.fragment_ && out.push("#", goog.Uri.encodeSpecialChars_(this.fragment_, goog.Uri.reDisallowedInFragment_));
  return this.cachedToString_ = out.join("")
};
goog.Uri.prototype.resolve = function $goog$Uri$$resolve$(relativeUri) {
  var absoluteUri = this.clone(), overridden = relativeUri.hasScheme();
  overridden ? absoluteUri.setScheme(relativeUri.getScheme()) : overridden = relativeUri.hasUserInfo();
  overridden ? absoluteUri.setUserInfo(relativeUri.getUserInfo()) : overridden = relativeUri.hasDomain();
  overridden ? absoluteUri.setDomain(relativeUri.getDomain()) : overridden = relativeUri.hasPort();
  var path = relativeUri.getPath();
  if(overridden) {
    absoluteUri.setPort(relativeUri.getPort())
  }else {
    if(overridden = relativeUri.hasPath()) {
      if("/" != path.charAt(0)) {
        if(this.hasDomain() && !this.hasPath()) {
          path = "/" + path
        }else {
          var lastSlashIndex = absoluteUri.getPath().lastIndexOf("/");
          -1 != lastSlashIndex && (path = absoluteUri.getPath().substr(0, lastSlashIndex + 1) + path)
        }
      }
      path = goog.Uri.removeDotSegments(path)
    }
  }
  overridden ? absoluteUri.setPath(path) : overridden = relativeUri.hasQuery();
  overridden ? absoluteUri.setQuery(relativeUri.getDecodedQuery()) : overridden = relativeUri.hasFragment();
  overridden && absoluteUri.setFragment(relativeUri.getFragment());
  return absoluteUri
};
goog.Uri.prototype.clone = function $goog$Uri$$clone$() {
  return goog.Uri.create(this.scheme_, this.userInfo_, this.domain_, this.port_, this.path_, this.queryData_.clone(), this.fragment_, this.ignoreCase_)
};
goog.Uri.prototype.getScheme = function $goog$Uri$$getScheme$() {
  return this.scheme_
};
goog.Uri.prototype.setScheme = function $goog$Uri$$setScheme$(newScheme, opt_decode) {
  this.enforceReadOnly();
  delete this.cachedToString_;
  if(this.scheme_ = opt_decode ? goog.Uri.decodeOrEmpty_(newScheme) : newScheme) {
    this.scheme_ = this.scheme_.replace(/:$/, "")
  }
  return this
};
goog.Uri.prototype.hasScheme = function $goog$Uri$$hasScheme$() {
  return!!this.scheme_
};
goog.Uri.prototype.getUserInfo = function $goog$Uri$$getUserInfo$() {
  return this.userInfo_
};
goog.Uri.prototype.setUserInfo = function $goog$Uri$$setUserInfo$(newUserInfo, opt_decode) {
  this.enforceReadOnly();
  delete this.cachedToString_;
  this.userInfo_ = opt_decode ? goog.Uri.decodeOrEmpty_(newUserInfo) : newUserInfo;
  return this
};
goog.Uri.prototype.hasUserInfo = function $goog$Uri$$hasUserInfo$() {
  return!!this.userInfo_
};
goog.Uri.prototype.getDomain = function $goog$Uri$$getDomain$() {
  return this.domain_
};
goog.Uri.prototype.setDomain = function $goog$Uri$$setDomain$(newDomain, opt_decode) {
  this.enforceReadOnly();
  delete this.cachedToString_;
  this.domain_ = opt_decode ? goog.Uri.decodeOrEmpty_(newDomain) : newDomain;
  return this
};
goog.Uri.prototype.hasDomain = function $goog$Uri$$hasDomain$() {
  return!!this.domain_
};
goog.Uri.prototype.getPort = function $goog$Uri$$getPort$() {
  return this.port_
};
goog.Uri.prototype.setPort = function $goog$Uri$$setPort$(newPort) {
  this.enforceReadOnly();
  delete this.cachedToString_;
  if(newPort) {
    newPort = Number(newPort);
    if(isNaN(newPort) || 0 > newPort) {
      throw Error("Bad port number " + newPort);
    }
    this.port_ = newPort
  }else {
    this.port_ = null
  }
  return this
};
goog.Uri.prototype.hasPort = function $goog$Uri$$hasPort$() {
  return null != this.port_
};
goog.Uri.prototype.getPath = function $goog$Uri$$getPath$() {
  return this.path_
};
goog.Uri.prototype.setPath = function $goog$Uri$$setPath$(newPath, opt_decode) {
  this.enforceReadOnly();
  delete this.cachedToString_;
  this.path_ = opt_decode ? goog.Uri.decodeOrEmpty_(newPath) : newPath;
  return this
};
goog.Uri.prototype.hasPath = function $goog$Uri$$hasPath$() {
  return!!this.path_
};
goog.Uri.prototype.hasQuery = function $goog$Uri$$hasQuery$() {
  return"" !== this.queryData_.toString()
};
goog.Uri.prototype.setQueryData = function $goog$Uri$$setQueryData$(queryData, opt_decode) {
  this.enforceReadOnly();
  delete this.cachedToString_;
  queryData instanceof goog.Uri.QueryData ? (this.queryData_ = queryData, this.queryData_.uri_ = this, this.queryData_.setIgnoreCase(this.ignoreCase_)) : (opt_decode || (queryData = goog.Uri.encodeSpecialChars_(queryData, goog.Uri.reDisallowedInQuery_)), this.queryData_ = new goog.Uri.QueryData(queryData, this, this.ignoreCase_));
  return this
};
goog.Uri.prototype.setQuery = function $goog$Uri$$setQuery$(newQuery, opt_decode) {
  return this.setQueryData(newQuery, opt_decode)
};
goog.Uri.prototype.getDecodedQuery = function $goog$Uri$$getDecodedQuery$() {
  return this.queryData_.toDecodedString()
};
goog.Uri.prototype.getQueryData = function $goog$Uri$$getQueryData$() {
  return this.queryData_
};
goog.Uri.prototype.setParameterValue = function $goog$Uri$$setParameterValue$(key, value) {
  this.enforceReadOnly();
  delete this.cachedToString_;
  this.queryData_.set(key, value);
  return this
};
goog.Uri.prototype.setParameterValues = function $goog$Uri$$setParameterValues$(key, values) {
  this.enforceReadOnly();
  delete this.cachedToString_;
  goog.isArray(values) || (values = ["" + values]);
  this.queryData_.setValues(key, values);
  return this
};
goog.Uri.prototype.getFragment = function $goog$Uri$$getFragment$() {
  return this.fragment_
};
goog.Uri.prototype.setFragment = function $goog$Uri$$setFragment$(newFragment, opt_decode) {
  this.enforceReadOnly();
  delete this.cachedToString_;
  this.fragment_ = opt_decode ? goog.Uri.decodeOrEmpty_(newFragment) : newFragment;
  return this
};
goog.Uri.prototype.hasFragment = function $goog$Uri$$hasFragment$() {
  return!!this.fragment_
};
goog.Uri.prototype.makeUnique = function $goog$Uri$$makeUnique$() {
  this.enforceReadOnly();
  this.setParameterValue(goog.Uri.RANDOM_PARAM, goog.string.getRandomString());
  return this
};
goog.Uri.prototype.enforceReadOnly = function $goog$Uri$$enforceReadOnly$() {
  if(this.isReadOnly_) {
    throw Error("Tried to modify a read-only Uri");
  }
};
goog.Uri.prototype.setIgnoreCase = function $goog$Uri$$setIgnoreCase$(ignoreCase) {
  this.ignoreCase_ = ignoreCase;
  this.queryData_ && this.queryData_.setIgnoreCase(ignoreCase);
  return this
};
goog.Uri.prototype.getIgnoreCase = function $goog$Uri$$getIgnoreCase$() {
  return this.ignoreCase_
};
goog.Uri.parse = function $goog$Uri$parse$(uri, opt_ignoreCase) {
  return uri instanceof goog.Uri ? uri.clone() : new goog.Uri(uri, opt_ignoreCase)
};
goog.Uri.create = function $goog$Uri$create$(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_query, opt_fragment, opt_ignoreCase) {
  var uri = new goog.Uri(null, opt_ignoreCase);
  opt_scheme && uri.setScheme(opt_scheme);
  opt_userInfo && uri.setUserInfo(opt_userInfo);
  opt_domain && uri.setDomain(opt_domain);
  opt_port && uri.setPort(opt_port);
  opt_path && uri.setPath(opt_path);
  opt_query && uri.setQueryData(opt_query);
  opt_fragment && uri.setFragment(opt_fragment);
  return uri
};
goog.Uri.resolve = function $goog$Uri$resolve$(base, rel) {
  base instanceof goog.Uri || (base = goog.Uri.parse(base));
  rel instanceof goog.Uri || (rel = goog.Uri.parse(rel));
  return base.resolve(rel)
};
goog.Uri.removeDotSegments = function $goog$Uri$removeDotSegments$(path) {
  if(".." == path || "." == path) {
    return""
  }
  if(!goog.string.contains(path, "./") && !goog.string.contains(path, "/.")) {
    return path
  }
  for(var leadingSlash = goog.string.startsWith(path, "/"), segments = path.split("/"), out = [], pos = 0;pos < segments.length;) {
    var segment = segments[pos++];
    "." == segment ? leadingSlash && pos == segments.length && out.push("") : ".." == segment ? ((1 < out.length || 1 == out.length && "" != out[0]) && out.pop(), leadingSlash && pos == segments.length && out.push("")) : (out.push(segment), leadingSlash = !0)
  }
  return out.join("/")
};
goog.Uri.decodeOrEmpty_ = function $goog$Uri$decodeOrEmpty_$(val) {
  return val ? decodeURIComponent(val) : ""
};
goog.Uri.encodeString_ = function $goog$Uri$encodeString_$(unescapedPart) {
  return goog.isString(unescapedPart) ? encodeURIComponent(unescapedPart) : null
};
goog.Uri.encodeSpecialRegExp_ = /^[a-zA-Z0-9\-_.!~*'():\/;?]*$/;
goog.Uri.encodeSpecialChars_ = function $goog$Uri$encodeSpecialChars_$(unescapedPart, extra) {
  var ret = null;
  goog.isString(unescapedPart) && (ret = unescapedPart, goog.Uri.encodeSpecialRegExp_.test(ret) || (ret = encodeURI(unescapedPart)), 0 <= ret.search(extra) && (ret = ret.replace(extra, goog.Uri.encodeChar_)));
  return ret
};
goog.Uri.encodeChar_ = function $goog$Uri$encodeChar_$(ch) {
  var n = ch.charCodeAt(0);
  return"%" + (n >> 4 & 15).toString(16) + (n & 15).toString(16)
};
goog.Uri.reDisallowedInSchemeOrUserInfo_ = /[#\/\?@]/g;
goog.Uri.reDisallowedInRelativePath_ = /[\#\?:]/g;
goog.Uri.reDisallowedInAbsolutePath_ = /[\#\?]/g;
goog.Uri.reDisallowedInQuery_ = /[\#\?@]/g;
goog.Uri.reDisallowedInFragment_ = /#/g;
goog.Uri.haveSameDomain = function $goog$Uri$haveSameDomain$(uri1String, uri2String) {
  var pieces1 = goog.uri.utils.split(uri1String), pieces2 = goog.uri.utils.split(uri2String);
  return pieces1[goog.uri.utils.ComponentIndex.DOMAIN] == pieces2[goog.uri.utils.ComponentIndex.DOMAIN] && pieces1[goog.uri.utils.ComponentIndex.PORT] == pieces2[goog.uri.utils.ComponentIndex.PORT]
};
goog.Uri.QueryData = function $goog$Uri$QueryData$(opt_query, opt_uri, opt_ignoreCase) {
  this.encodedQuery_ = opt_query || null;
  this.uri_ = opt_uri || null;
  this.ignoreCase_ = !!opt_ignoreCase
};
goog.Uri.QueryData.prototype.ensureKeyMapInitialized_ = function $goog$Uri$QueryData$$ensureKeyMapInitialized_$() {
  if(!this.keyMap_ && (this.keyMap_ = new goog.structs.Map, this.count_ = 0, this.encodedQuery_)) {
    for(var pairs = this.encodedQuery_.split("&"), i = 0;i < pairs.length;i++) {
      var indexOfEquals = pairs[i].indexOf("="), name = null, value = null;
      0 <= indexOfEquals ? (name = pairs[i].substring(0, indexOfEquals), value = pairs[i].substring(indexOfEquals + 1)) : name = pairs[i];
      name = goog.string.urlDecode(name);
      name = this.getKeyName_(name);
      this.add(name, value ? goog.string.urlDecode(value) : "")
    }
  }
};
goog.Uri.QueryData.createFromMap = function $goog$Uri$QueryData$createFromMap$(map, opt_uri, opt_ignoreCase) {
  var keys = goog.structs.getKeys(map);
  if("undefined" == typeof keys) {
    throw Error("Keys are undefined");
  }
  return goog.Uri.QueryData.createFromKeysValues(keys, goog.structs.getValues(map), opt_uri, opt_ignoreCase)
};
goog.Uri.QueryData.createFromKeysValues = function $goog$Uri$QueryData$createFromKeysValues$(keys, values, opt_uri, opt_ignoreCase) {
  if(keys.length != values.length) {
    throw Error("Mismatched lengths for keys/values");
  }
  for(var queryData = new goog.Uri.QueryData(null, opt_uri, opt_ignoreCase), i = 0;i < keys.length;i++) {
    queryData.add(keys[i], values[i])
  }
  return queryData
};
goog.Uri.QueryData.prototype.keyMap_ = null;
goog.Uri.QueryData.prototype.count_ = null;
goog.Uri.QueryData.decodedQuery_ = null;
goog.Uri.QueryData.prototype.getCount = function $goog$Uri$QueryData$$getCount$() {
  this.ensureKeyMapInitialized_();
  return this.count_
};
goog.Uri.QueryData.prototype.add = function $goog$Uri$QueryData$$add$(key, value) {
  this.ensureKeyMapInitialized_();
  this.invalidateCache_();
  key = this.getKeyName_(key);
  if(this.containsKey(key)) {
    var current = this.keyMap_.get(key);
    goog.isArray(current) ? current.push(value) : this.keyMap_.set(key, [current, value])
  }else {
    this.keyMap_.set(key, value)
  }
  this.count_++;
  return this
};
goog.Uri.QueryData.prototype.remove = function $goog$Uri$QueryData$$remove$(key) {
  this.ensureKeyMapInitialized_();
  key = this.getKeyName_(key);
  if(this.keyMap_.containsKey(key)) {
    this.invalidateCache_();
    var old = this.keyMap_.get(key);
    goog.isArray(old) ? this.count_ -= old.length : this.count_--;
    return this.keyMap_.remove(key)
  }
  return!1
};
goog.Uri.QueryData.prototype.clear = function $goog$Uri$QueryData$$clear$() {
  this.invalidateCache_();
  this.keyMap_ && this.keyMap_.clear();
  this.count_ = 0
};
goog.Uri.QueryData.prototype.isEmpty = function $goog$Uri$QueryData$$isEmpty$() {
  this.ensureKeyMapInitialized_();
  return 0 == this.count_
};
goog.Uri.QueryData.prototype.containsKey = function $goog$Uri$QueryData$$containsKey$(key) {
  this.ensureKeyMapInitialized_();
  key = this.getKeyName_(key);
  return this.keyMap_.containsKey(key)
};
goog.Uri.QueryData.prototype.containsValue = function $goog$Uri$QueryData$$containsValue$(value) {
  var vals = this.getValues();
  return goog.array.contains(vals, value)
};
goog.Uri.QueryData.prototype.getKeys = function $goog$Uri$QueryData$$getKeys$() {
  this.ensureKeyMapInitialized_();
  for(var vals = this.keyMap_.getValues(), keys = this.keyMap_.getKeys(), rv = [], i = 0;i < keys.length;i++) {
    var val = vals[i];
    if(goog.isArray(val)) {
      for(var j = 0;j < val.length;j++) {
        rv.push(keys[i])
      }
    }else {
      rv.push(keys[i])
    }
  }
  return rv
};
goog.Uri.QueryData.prototype.getValues = function $goog$Uri$QueryData$$getValues$(opt_key) {
  this.ensureKeyMapInitialized_();
  var rv = [];
  if(opt_key) {
    var key = this.getKeyName_(opt_key);
    this.containsKey(key) && (rv = goog.array.concat(rv, this.keyMap_.get(key)))
  }else {
    for(var values = this.keyMap_.getValues(), i = 0;i < values.length;i++) {
      rv = goog.array.concat(rv, values[i])
    }
  }
  return rv
};
goog.Uri.QueryData.prototype.set = function $goog$Uri$QueryData$$set$(key, value) {
  this.ensureKeyMapInitialized_();
  this.invalidateCache_();
  key = this.getKeyName_(key);
  if(this.containsKey(key)) {
    var old = this.keyMap_.get(key);
    goog.isArray(old) ? this.count_ -= old.length : this.count_--
  }
  this.keyMap_.set(key, value);
  this.count_++;
  return this
};
goog.Uri.QueryData.prototype.get = function $goog$Uri$QueryData$$get$(key, opt_default) {
  this.ensureKeyMapInitialized_();
  key = this.getKeyName_(key);
  if(this.containsKey(key)) {
    var val = this.keyMap_.get(key);
    return goog.isArray(val) ? val[0] : val
  }
  return opt_default
};
goog.Uri.QueryData.prototype.setValues = function $goog$Uri$QueryData$$setValues$(key, values) {
  this.ensureKeyMapInitialized_();
  this.invalidateCache_();
  key = this.getKeyName_(key);
  if(this.containsKey(key)) {
    var old = this.keyMap_.get(key);
    goog.isArray(old) ? this.count_ -= old.length : this.count_--
  }
  0 < values.length && (this.keyMap_.set(key, values), this.count_ += values.length)
};
goog.Uri.QueryData.prototype.toString = function $goog$Uri$QueryData$$toString$() {
  if(this.encodedQuery_) {
    return this.encodedQuery_
  }
  if(!this.keyMap_) {
    return""
  }
  for(var sb = [], count = 0, keys = this.keyMap_.getKeys(), i = 0;i < keys.length;i++) {
    var key = keys[i], encodedKey = goog.string.urlEncode(key), val = this.keyMap_.get(key);
    if(goog.isArray(val)) {
      for(var j = 0;j < val.length;j++) {
        0 < count && sb.push("&"), sb.push(encodedKey), "" !== val[j] && sb.push("=", goog.string.urlEncode(val[j])), count++
      }
    }else {
      0 < count && sb.push("&"), sb.push(encodedKey), "" !== val && sb.push("=", goog.string.urlEncode(val)), count++
    }
  }
  return this.encodedQuery_ = sb.join("")
};
goog.Uri.QueryData.prototype.toDecodedString = function $goog$Uri$QueryData$$toDecodedString$() {
  this.decodedQuery_ || (this.decodedQuery_ = goog.Uri.decodeOrEmpty_(this.toString()));
  return this.decodedQuery_
};
goog.Uri.QueryData.prototype.invalidateCache_ = function $goog$Uri$QueryData$$invalidateCache_$() {
  delete this.decodedQuery_;
  delete this.encodedQuery_;
  this.uri_ && delete this.uri_.cachedToString_
};
goog.Uri.QueryData.prototype.clone = function $goog$Uri$QueryData$$clone$() {
  var rv = new goog.Uri.QueryData;
  this.decodedQuery_ && (rv.decodedQuery_ = this.decodedQuery_);
  this.encodedQuery_ && (rv.encodedQuery_ = this.encodedQuery_);
  this.keyMap_ && (rv.keyMap_ = this.keyMap_.clone());
  return rv
};
goog.Uri.QueryData.prototype.getKeyName_ = function $goog$Uri$QueryData$$getKeyName_$(arg) {
  var keyName = "" + arg;
  this.ignoreCase_ && (keyName = keyName.toLowerCase());
  return keyName
};
goog.Uri.QueryData.prototype.setIgnoreCase = function $goog$Uri$QueryData$$setIgnoreCase$(ignoreCase) {
  var resetKeys = ignoreCase && !this.ignoreCase_;
  resetKeys && (this.ensureKeyMapInitialized_(), this.invalidateCache_(), goog.structs.forEach(this.keyMap_, function(value, key) {
    var lowerCase = key.toLowerCase();
    key != lowerCase && (this.remove(key), this.add(lowerCase, value))
  }, this));
  this.ignoreCase_ = ignoreCase
};
goog.Uri.QueryData.prototype.extend = function $goog$Uri$QueryData$$extend$(var_args) {
  for(var i = 0;i < arguments.length;i++) {
    var data = arguments[i];
    goog.structs.forEach(data, function(value, key) {
      this.add(key, value)
    }, this)
  }
};
/*
 Portions of this code are from MochiKit, received by
 The Closure Authors under the MIT license. All other code is Copyright
 2005-2009 The Closure Authors. All Rights Reserved.
*/
goog.async = {};
goog.async.Deferred = function $goog$async$Deferred$(opt_canceller, opt_defaultScope) {
  this.chain_ = [];
  this.canceller_ = opt_canceller;
  this.defaultScope_ = opt_defaultScope || null
};
goog.async.Deferred.prototype.fired_ = !1;
goog.async.Deferred.prototype.hadError_ = !1;
goog.async.Deferred.prototype.paused_ = 0;
goog.async.Deferred.prototype.silentlyCancelled_ = !1;
goog.async.Deferred.prototype.chained_ = !1;
goog.async.Deferred.prototype.branches_ = 0;
goog.async.Deferred.prototype.cancel = function $goog$async$Deferred$$cancel$(opt_deepCancel) {
  if(this.hasFired()) {
    this.result_ instanceof goog.async.Deferred && this.result_.cancel()
  }else {
    if(this.parent_) {
      var parent = this.parent_;
      delete this.parent_;
      opt_deepCancel ? parent.cancel(opt_deepCancel) : parent.branchCancel_()
    }
    this.canceller_ ? this.canceller_.call(this.defaultScope_, this) : this.silentlyCancelled_ = !0;
    this.hasFired() || this.errback(new goog.async.Deferred.CancelledError(this))
  }
};
goog.async.Deferred.prototype.branchCancel_ = function $goog$async$Deferred$$branchCancel_$() {
  this.branches_--;
  0 >= this.branches_ && this.cancel()
};
goog.async.Deferred.prototype.pause_ = function $goog$async$Deferred$$pause_$() {
  this.paused_++
};
goog.async.Deferred.prototype.unpause_ = function $goog$async$Deferred$$unpause_$() {
  this.paused_--;
  0 == this.paused_ && this.hasFired() && this.fire_()
};
goog.async.Deferred.prototype.continue_ = function $goog$async$Deferred$$continue_$(isSuccess, res) {
  this.resback_(isSuccess, res);
  this.unpause_()
};
goog.async.Deferred.prototype.resback_ = function $goog$async$Deferred$$resback_$(isSuccess, res) {
  this.fired_ = !0;
  this.result_ = res;
  this.hadError_ = !isSuccess;
  this.fire_()
};
goog.async.Deferred.prototype.check_ = function $goog$async$Deferred$$check_$() {
  if(this.hasFired()) {
    if(!this.silentlyCancelled_) {
      throw new goog.async.Deferred.AlreadyCalledError(this);
    }
    this.silentlyCancelled_ = !1
  }
};
goog.async.Deferred.prototype.callback = function $goog$async$Deferred$$callback$(result) {
  this.check_();
  this.assertNotDeferred_(result);
  this.resback_(!0, result)
};
goog.async.Deferred.prototype.errback = function $goog$async$Deferred$$errback$(result) {
  this.check_();
  this.assertNotDeferred_(result);
  this.resback_(!1, result)
};
goog.async.Deferred.prototype.assertNotDeferred_ = function $goog$async$Deferred$$assertNotDeferred_$(obj) {
  goog.asserts.assert(!(obj instanceof goog.async.Deferred), "Deferred instances can only be chained if they are the result of a callback")
};
goog.async.Deferred.prototype.addCallback = function $goog$async$Deferred$$addCallback$(cb, opt_scope) {
  return this.addCallbacks(cb, null, opt_scope)
};
goog.async.Deferred.prototype.addErrback = function $goog$async$Deferred$$addErrback$(eb, opt_scope) {
  return this.addCallbacks(null, eb, opt_scope)
};
goog.async.Deferred.prototype.addCallbacks = function $goog$async$Deferred$$addCallbacks$(cb, eb, opt_scope) {
  goog.asserts.assert(!this.chained_, "Chained Deferreds can not be re-used");
  this.chain_.push([cb, eb, opt_scope]);
  this.hasFired() && this.fire_();
  return this
};
goog.async.Deferred.prototype.chainDeferred = function $goog$async$Deferred$$chainDeferred$(otherDeferred) {
  this.addCallbacks(otherDeferred.callback, otherDeferred.errback, otherDeferred);
  return this
};
goog.async.Deferred.prototype.branch = function $goog$async$Deferred$$branch$(opt_propagateCancel) {
  var d = new goog.async.Deferred;
  this.chainDeferred(d);
  opt_propagateCancel && (d.parent_ = this, this.branches_++);
  return d
};
goog.async.Deferred.prototype.addBoth = function $goog$async$Deferred$$addBoth$(f, opt_scope) {
  return this.addCallbacks(f, f, opt_scope)
};
goog.async.Deferred.prototype.hasFired = function $goog$async$Deferred$$hasFired$() {
  return this.fired_
};
goog.async.Deferred.prototype.isError = function $goog$async$Deferred$$isError$(res) {
  return res instanceof Error
};
goog.async.Deferred.prototype.hasErrback_ = function $goog$async$Deferred$$hasErrback_$() {
  return goog.array.some(this.chain_, function(chainRow) {
    return goog.isFunction(chainRow[1])
  })
};
goog.async.Deferred.prototype.fire_ = function $goog$async$Deferred$$fire_$() {
  this.unhandledExceptionTimeoutId_ && this.hasFired() && this.hasErrback_() && (goog.global.clearTimeout(this.unhandledExceptionTimeoutId_), delete this.unhandledExceptionTimeoutId_);
  this.parent_ && (this.parent_.branches_--, delete this.parent_);
  for(var res = this.result_, unhandledException = !1, isChained = !1;this.chain_.length && 0 == this.paused_;) {
    var chainEntry = this.chain_.shift(), callback = chainEntry[0], errback = chainEntry[1], scope = chainEntry[2], f = this.hadError_ ? errback : callback;
    if(f) {
      try {
        var ret = f.call(scope || this.defaultScope_, res);
        goog.isDef(ret) && (this.hadError_ = this.hadError_ && (ret == res || this.isError(ret)), this.result_ = res = ret);
        res instanceof goog.async.Deferred && (isChained = !0, this.pause_())
      }catch(ex) {
        res = ex, this.hadError_ = !0, this.hasErrback_() || (unhandledException = !0)
      }
    }
  }
  this.result_ = res;
  isChained && this.paused_ && (res.addCallbacks(goog.bind(this.continue_, this, !0), goog.bind(this.continue_, this, !1)), res.chained_ = !0);
  unhandledException && (this.unhandledExceptionTimeoutId_ = goog.global.setTimeout(function() {
    throw new goog.async.Deferred.UnhandledError(res);
  }, 0))
};
goog.async.Deferred.succeed = function $goog$async$Deferred$succeed$(res) {
  var d = new goog.async.Deferred;
  d.callback(res);
  return d
};
goog.async.Deferred.fail = function $goog$async$Deferred$fail$(res) {
  var d = new goog.async.Deferred;
  d.errback(res);
  return d
};
goog.async.Deferred.cancelled = function $goog$async$Deferred$cancelled$() {
  var d = new goog.async.Deferred;
  d.cancel();
  return d
};
goog.async.Deferred.when = function $goog$async$Deferred$when$(value, callback, opt_scope) {
  return value instanceof goog.async.Deferred ? value.branch(!0).addCallback(callback, opt_scope) : goog.async.Deferred.succeed(value).addCallback(callback, opt_scope)
};
goog.async.Deferred.AlreadyCalledError = function $goog$async$Deferred$AlreadyCalledError$() {
  goog.debug.Error.call(this)
};
goog.inherits(goog.async.Deferred.AlreadyCalledError, goog.debug.Error);
goog.async.Deferred.AlreadyCalledError.prototype.message = "Already called";
goog.async.Deferred.CancelledError = function $goog$async$Deferred$CancelledError$() {
  goog.debug.Error.call(this)
};
goog.inherits(goog.async.Deferred.CancelledError, goog.debug.Error);
goog.async.Deferred.CancelledError.prototype.message = "Deferred was cancelled";
goog.async.Deferred.UnhandledError = function $goog$async$Deferred$UnhandledError$(cause) {
  goog.debug.Error.call(this);
  this.message = "Unhandled Error in Deferred: " + (cause.message || "[No message]")
};
goog.inherits(goog.async.Deferred.UnhandledError, goog.debug.Error);
goog.net = {};
goog.net.jsloader = {};
goog.net.jsloader.GLOBAL_VERIFY_OBJS_ = "closure_verification";
goog.net.jsloader.DEFAULT_TIMEOUT = 5E3;
goog.net.jsloader.scriptsToLoad_ = [];
goog.net.jsloader.loadMany = function $goog$net$jsloader$loadMany$(uris, opt_options) {
  if(uris.length) {
    if(goog.userAgent.GECKO && !goog.userAgent.isVersion(2)) {
      for(var i = 0;i < uris.length;i++) {
        goog.net.jsloader.load(uris[i], opt_options)
      }
    }else {
      var isAnotherModuleLoading = goog.net.jsloader.scriptsToLoad_.length;
      goog.array.extend(goog.net.jsloader.scriptsToLoad_, uris);
      if(!isAnotherModuleLoading) {
        var uris = goog.net.jsloader.scriptsToLoad_, popAndLoadNextScript = function $popAndLoadNextScript$() {
          var uri = uris.shift(), deferred = goog.net.jsloader.load(uri, opt_options);
          uris.length && deferred.addBoth(popAndLoadNextScript)
        };
        popAndLoadNextScript()
      }
    }
  }
};
goog.net.jsloader.load = function $goog$net$jsloader$load$(uri, opt_options) {
  var options = opt_options || {}, doc = options.document || document, script = goog.dom.createElement(goog.dom.TagName.SCRIPT), request = {script_:script, timeout_:void 0}, deferred = new goog.async.Deferred(goog.net.jsloader.cancel_, request), timeout = null, timeoutDuration = goog.isDefAndNotNull(options.timeout) ? options.timeout : goog.net.jsloader.DEFAULT_TIMEOUT;
  0 < timeoutDuration && (timeout = window.setTimeout(function() {
    goog.net.jsloader.cleanup_(script, !0);
    deferred.errback(new goog.net.jsloader.Error(goog.net.jsloader.ErrorCode.TIMEOUT, "Timeout reached for loading script " + uri))
  }, timeoutDuration), request.timeout_ = timeout);
  script.onload = script.onreadystatechange = function $script$onreadystatechange$() {
    if(!script.readyState || script.readyState == "loaded" || script.readyState == "complete") {
      var removeScriptNode = options.cleanupWhenDone || false;
      goog.net.jsloader.cleanup_(script, removeScriptNode, timeout);
      deferred.callback(null)
    }
  };
  script.onerror = function $script$onerror$() {
    goog.net.jsloader.cleanup_(script, true, timeout);
    deferred.errback(new goog.net.jsloader.Error(goog.net.jsloader.ErrorCode.LOAD_ERROR, "Error while loading script " + uri))
  };
  goog.dom.setProperties(script, {type:"text/javascript", charset:"UTF-8", src:uri});
  var scriptParent = goog.net.jsloader.getScriptParentElement_(doc);
  scriptParent.appendChild(script);
  return deferred
};
goog.net.jsloader.loadAndVerify = function $goog$net$jsloader$loadAndVerify$(uri, verificationObjName, options) {
  goog.global[goog.net.jsloader.GLOBAL_VERIFY_OBJS_] || (goog.global[goog.net.jsloader.GLOBAL_VERIFY_OBJS_] = {});
  var verifyObjs = goog.global[goog.net.jsloader.GLOBAL_VERIFY_OBJS_];
  if(goog.isDef(verifyObjs[verificationObjName])) {
    return goog.async.Deferred.fail(new goog.net.jsloader.Error(goog.net.jsloader.ErrorCode.VERIFY_OBJECT_ALREADY_EXISTS, "Verification object " + verificationObjName + " already defined."))
  }
  var sendDeferred = goog.net.jsloader.load(uri, options), deferred = new goog.async.Deferred(sendDeferred.cancel);
  sendDeferred.addCallback(function() {
    var result = verifyObjs[verificationObjName];
    goog.isDef(result) ? (deferred.callback(result), delete verifyObjs[verificationObjName]) : deferred.errback(new goog.net.jsloader.Error(goog.net.jsloader.ErrorCode.VERIFY_ERROR, "Script " + uri + " loaded, but verification object " + verificationObjName + " was not defined."))
  });
  sendDeferred.addErrback(function(error) {
    goog.isDef(verifyObjs[verificationObjName]) && delete verifyObjs[verificationObjName];
    deferred.errback(error)
  });
  return deferred
};
goog.net.jsloader.getScriptParentElement_ = function $goog$net$jsloader$getScriptParentElement_$(doc) {
  var headElements = doc.getElementsByTagName(goog.dom.TagName.HEAD);
  return!headElements || goog.array.isEmpty(headElements) ? doc.documentElement : headElements[0]
};
goog.net.jsloader.cancel_ = function $goog$net$jsloader$cancel_$() {
  var request = this;
  if(request && request.script_) {
    var scriptNode = request.script_;
    scriptNode && "SCRIPT" == scriptNode.tagName && goog.net.jsloader.cleanup_(scriptNode, !0, request.timeout_)
  }
};
goog.net.jsloader.cleanup_ = function $goog$net$jsloader$cleanup_$(scriptNode, removeScriptNode, opt_timeout) {
  goog.isDefAndNotNull(opt_timeout) && goog.global.clearTimeout(opt_timeout);
  scriptNode.onload = goog.nullFunction;
  scriptNode.onerror = goog.nullFunction;
  scriptNode.onreadystatechange = goog.nullFunction;
  removeScriptNode && window.setTimeout(function() {
    goog.dom.removeNode(scriptNode)
  }, 0)
};
goog.net.jsloader.ErrorCode = {LOAD_ERROR:0, TIMEOUT:1, VERIFY_ERROR:2, VERIFY_OBJECT_ALREADY_EXISTS:3};
goog.net.jsloader.Error = function $goog$net$jsloader$Error$(code, opt_message) {
  var msg = "Jsloader error (code #" + code + ")";
  opt_message && (msg += ": " + opt_message);
  goog.debug.Error.call(this, msg);
  this.code = code
};
goog.inherits(goog.net.jsloader.Error, goog.debug.Error);
goog.net.Jsonp = function $goog$net$Jsonp$(uri, opt_callbackParamName) {
  this.uri_ = new goog.Uri(uri);
  this.callbackParamName_ = opt_callbackParamName ? opt_callbackParamName : "callback";
  this.timeout_ = 5E3
};
goog.net.Jsonp.CALLBACKS = "_callbacks_";
goog.net.Jsonp.scriptCounter_ = 0;
goog.net.Jsonp.prototype.send = function $goog$net$Jsonp$$send$(opt_payload, opt_replyCallback, opt_errorCallback, opt_callbackParamValue) {
  var payload = opt_payload || null, id = opt_callbackParamValue || "_" + (goog.net.Jsonp.scriptCounter_++).toString(36) + goog.now().toString(36);
  goog.global[goog.net.Jsonp.CALLBACKS] || (goog.global[goog.net.Jsonp.CALLBACKS] = {});
  var uri = this.uri_.clone();
  payload && goog.net.Jsonp.addPayloadToUri_(payload, uri);
  if(opt_replyCallback) {
    var reply = goog.net.Jsonp.newReplyHandler_(id, opt_replyCallback);
    goog.global[goog.net.Jsonp.CALLBACKS][id] = reply;
    uri.setParameterValues(this.callbackParamName_, goog.net.Jsonp.CALLBACKS + "." + id)
  }
  var deferred = goog.net.jsloader.load(uri.toString(), {timeout:this.timeout_, cleanupWhenDone:!0}), error = goog.net.Jsonp.newErrorHandler_(id, payload, opt_errorCallback);
  deferred.addErrback(error);
  return{id_:id, deferred_:deferred}
};
goog.net.Jsonp.prototype.cancel = function $goog$net$Jsonp$$cancel$(request) {
  request && (request.deferred_ && request.deferred_.cancel(), request.id_ && goog.net.Jsonp.cleanup_(request.id_, !1))
};
goog.net.Jsonp.newErrorHandler_ = function $goog$net$Jsonp$newErrorHandler_$(id, payload, opt_errorCallback) {
  return function() {
    goog.net.Jsonp.cleanup_(id, !1);
    opt_errorCallback && opt_errorCallback(payload)
  }
};
goog.net.Jsonp.newReplyHandler_ = function $goog$net$Jsonp$newReplyHandler_$(id, replyCallback) {
  return function(var_args) {
    goog.net.Jsonp.cleanup_(id, !0);
    replyCallback.apply(void 0, arguments)
  }
};
goog.net.Jsonp.cleanup_ = function $goog$net$Jsonp$cleanup_$(id, deleteReplyHandler) {
  goog.global[goog.net.Jsonp.CALLBACKS][id] && (deleteReplyHandler ? delete goog.global[goog.net.Jsonp.CALLBACKS][id] : goog.global[goog.net.Jsonp.CALLBACKS][id] = goog.nullFunction)
};
goog.net.Jsonp.addPayloadToUri_ = function $goog$net$Jsonp$addPayloadToUri_$(payload, uri) {
  for(var name in payload) {
    (!payload.hasOwnProperty || payload.hasOwnProperty(name)) && uri.setParameterValues(name, payload[name])
  }
  return uri
};
goog.ime.net.JsonpService = function $goog$ime$net$JsonpService$(opt_server, opt_callbackParam) {
  goog.Disposable.call(this);
  this.server_ = opt_server || goog.ime.net.JsonpService.DEFAULT_SERVER_URL;
  this.callbackParam_ = opt_callbackParam || goog.ime.net.JsonpService.CALLBACK_PARAM
};
goog.inherits(goog.ime.net.JsonpService, goog.Disposable);
goog.ime.net.JsonpService.CALLBACK_PARAM = "cb";
goog.ime.net.JsonpService.DEFAULT_SERVER_URL = "//www.google.com";
goog.ime.net.JsonpService.prototype.disposeInternal = function $goog$ime$net$JsonpService$$disposeInternal$() {
  this.jsonp_ && this.abort(this.pendingRequestId_);
  this.jsonp_ = null
};
goog.ime.net.JsonpService.prototype.send = function $goog$ime$net$JsonpService$$send$(url, payload, callback, opt_handler) {
  this.pendingRequestId_ && this.abort(this.pendingRequestId_);
  var url = this.server_ + url, jsonpId = url + "&" + this.callbackParam_;
  jsonpId != this.jsonpId_ && (this.jsonp_ = new goog.net.Jsonp(url, this.callbackParam_), this.jsonpId_ = jsonpId);
  payload && goog.Uri.QueryData.createFromMap(payload);
  var handlerCallback = goog.bind(callback, opt_handler), requestId = this.jsonp_.send(payload, goog.bind(this.responseHandler_, this, handlerCallback, !0), goog.bind(this.responseHandler_, this, handlerCallback, !1));
  return this.pendingRequestId_ = {reqId:requestId, key:this.jsonpId_}
};
goog.ime.net.JsonpService.prototype.abort = function $goog$ime$net$JsonpService$$abort$(id) {
  id.key == this.jsonpId_ && this.jsonp_.cancel(id.reqId)
};
goog.ime.net.JsonpService.prototype.responseHandler_ = function $goog$ime$net$JsonpService$$responseHandler_$(callback, isSuccess, responseJson) {
  callback(isSuccess, isSuccess ? responseJson : null);
  this.pendingRequestId_ = null
};
goog.ime.api.ita.InputMethodUtil = {};
goog.ime.api.ita.InputMethodUtil.getAsyncHttpService = function $goog$ime$api$ita$InputMethodUtil$getAsyncHttpService$() {
  return new goog.ime.net.JsonpService
};
goog.ime.api.ita.InputMethod = function $goog$ime$api$ita$InputMethod$(eventTarget, opt_config) {
  this.domManager_ = new goog.ime.api.ita.DomManager;
  this.translitPlugin_ = goog.ime.plugin.lang.buildTranslitPlugin(goog.ime.api.ita.InputMethodUtil.getAsyncHttpService());
  this.eventTarget_ = eventTarget;
  this.autoDirection_ = !1;
  this.registeredTextInputs_ = [];
  this.shortcut_ = opt_config ? opt_config.shortcut : "";
  goog.ime.api.ita.InputMethod.Css && (goog.style.installStyles(goog.ime.api.ita.InputMethod.Css), goog.ime.api.ita.InputMethod.Css = "")
};
goog.inherits(goog.ime.api.ita.InputMethod, goog.Disposable);
goog.ime.api.ita.InputMethod.Css = "";
goog.ime.api.ita.InputMethod.prototype.setApplicationName = function $goog$ime$api$ita$InputMethod$$setApplicationName$(appName) {
  goog.ime.plugin.lang.TranslitQuery.applicationName = appName
};
goog.ime.api.ita.InputMethod.prototype.handleEvent = function $goog$ime$api$ita$InputMethod$$handleEvent$(target, e) {
  var textInput = this.domManager_.getOrCreateTextInput(target);
  return!!textInput && textInput.dispatchEvent(e)
};
goog.ime.api.ita.InputMethod.prototype.handleEventFromTarget_ = function $goog$ime$api$ita$InputMethod$$handleEventFromTarget_$(textInput, e) {
  var ret = !1;
  if(e instanceof goog.ui.KeyboardShortcutEvent) {
    if(e.identifier == goog.ime.plugin.CommandType.TOGGLE_ITA) {
      var inputTool = this.translitPlugin_.getCurrentInputTool(), active = this.translitPlugin_.isActive();
      this.activateInputTool(inputTool, !active);
      ret = !0
    }else {
      ret = this.translitPlugin_.handleShortcut(textInput, e)
    }
  }else {
    ret = this.translitPlugin_.handleEvent(textInput, e)
  }
  return ret
};
goog.ime.api.ita.InputMethod.prototype.register = function $goog$ime$api$ita$InputMethod$$register$(elements) {
  if(goog.isArrayLike(elements)) {
    var eventTypes = this.translitPlugin_.getEventTypes();
    goog.array.forEach(elements, function(element) {
      var textInput = this.domManager_.getOrCreateTextInput(element);
      goog.array.contains(this.registeredTextInputs_, textInput) || (this.registeredTextInputs_.push(textInput), this.translitPlugin_.register(textInput), textInput.listen(eventTypes), this.shortcut_ && textInput.listenShortcut(this.shortcut_, goog.ime.plugin.CommandType.TOGGLE_ITA), textInput.addEventListener(goog.array.concat(eventTypes, goog.ui.KeyboardShortcutHandler.EventType.SHORTCUT_TRIGGERED), goog.bind(this.handleEventFromTarget_, this, textInput)), textInput.addEventListener([goog.ime.api.ita.ControlEventType.STATUS_BAR, 
      goog.ime.plugin.keyboard.EventType.CLOSE_KEYBOARD], this.eventTarget_.dispatchEvent, !1, this.eventTarget_))
    }, this)
  }
};
goog.ime.api.ita.InputMethod.prototype.unregister = function $goog$ime$api$ita$InputMethod$$unregister$(elements) {
  if(goog.isArrayLike(elements)) {
    var eventTypes = this.translitPlugin_.getEventTypes();
    goog.array.forEach(elements, function(element) {
      var textInput = this.domManager_.getOrCreateTextInput(element);
      goog.array.contains(this.registeredTextInputs_, textInput) && (goog.array.remove(this.registeredTextInputs_, textInput), this.translitPlugin_.unregister(textInput), textInput.unlisten(eventTypes), this.shortcut_ && textInput.unlistenShortcut(this.shortcut_, goog.ime.plugin.CommandType.TOGGLE_ITA), goog.events.removeAll(textInput))
    }, this)
  }
};
goog.ime.api.ita.InputMethod.prototype.activateInputTool = function $goog$ime$api$ita$InputMethod$$activateInputTool$(inputTool, active) {
  var args = [goog.ime.plugin.CommandType.CHANGE_STATE, inputTool, active];
  this.translitPlugin_.execCommand.apply(this.translitPlugin_, args);
  active && inputTool && this.autoDirection_ && (args = [goog.ime.plugin.CommandType.CHANGE_DIRECTION, inputTool.getDirection()], this.translitPlugin_.execCommand.apply(this.translitPlugin_, args))
};
goog.ime.api.ita.InputMethod.prototype.execCommand = function $goog$ime$api$ita$InputMethod$$execCommand$(command, var_args) {
  return this.translitPlugin_.execCommand.apply(this.translitPlugin_, arguments)
};
goog.ime.api.ita.InputMethod.prototype.setAutoDirection = function $goog$ime$api$ita$InputMethod$$setAutoDirection$(enable) {
  this.autoDirection_ = enable
};
goog.ime.api.ita.InputMethod.prototype.disposeInternal = function $goog$ime$api$ita$InputMethod$$disposeInternal$() {
  goog.ime.api.ita.InputMethod.superClass_.disposeInternal.call(this);
  this.domManager_.dispose();
  this.translitPlugin_.dispose();
  this.eventTarget_ = null
};
goog.ime.api.ita.InputToolManager = function $goog$ime$api$ita$InputToolManager$() {
  this.inputToolsInPage = [];
  this.currentInputToolState = !1
};
goog.ime.ui.Hover = {};
goog.ime.ui.Hover.addHover = function $goog$ime$ui$Hover$addHover$(element, className) {
  goog.events.listen(element, goog.events.EventType.MOUSEOVER, goog.bind(goog.ime.ui.Hover.addHoverClass_, null, element, className));
  goog.events.listen(element, goog.events.EventType.MOUSEOUT, goog.bind(goog.ime.ui.Hover.removeHoverClass_, null, element, className))
};
goog.ime.ui.Hover.addHoverClass_ = function $goog$ime$ui$Hover$addHoverClass_$(element, className) {
  goog.dom.classes.add(element, className + "-hover")
};
goog.ime.ui.Hover.removeHoverClass_ = function $goog$ime$ui$Hover$removeHoverClass_$(element, className) {
  goog.dom.classes.remove(element, className + "-hover")
};
goog.ime.ui.Hover.removeHover = function $goog$ime$ui$Hover$removeHover$(element, className) {
  goog.events.unlisten(element, goog.events.EventType.MOUSEOVER, goog.bind(goog.ime.ui.Hover.addHoverClass_, null, element, className));
  goog.events.unlisten(element, goog.events.EventType.MOUSEOUT, goog.bind(goog.ime.ui.Hover.removeHoverClass_, null, element, className))
};
goog.ime.api.ita.InputToolInfo = {};
goog.ime.api.ita.MAX_INT = 2147483647;
goog.ime.api.ita.InputToolInfo.INPUT_TOOL_NAME = {im_t13n_am:"\u12a0\u121b\u122d\u129b", im_t13n_ar:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629", im_t13n_bn:"\u09ac\u09be\u0982\u09b2\u09be", im_pinyin_zh_hans:"\u62fc\u97f3", im_pinyin_zh_hant:"\u62fc\u97f3(\u7e41\u4f53\u4e2d\u6587)", im_wubi_zh_hans:"\u4e94\u7b14", im_zhuyin_zh_hant:"\u6ce8\u97f3", im_t13n_en:"English", im_t13n_el:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac", im_t13n_fa:"\u0641\u0627\u0631\u0633\u06cc", im_t13n_gu:"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0", 
im_t13n_hi:"\u0939\u093f\u0928\u094d\u0926\u0940", im_t13n_iw:"\u05ea\u05d9\u05e8\u05b4\u05d1\u05b0\u05e2\u05b4", im_t13n_he:"\u05ea\u05d9\u05e8\u05b4\u05d1\u05b0\u05e2\u05b4", im_t13n_ja:"\u65e5\u672c\u8a9e", im_t13n_kn:"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1", im_t13n_ml:"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02", im_t13n_mr:"\u092e\u0930\u093e\u0920\u0940", im_t13n_ne:"\u0928\u0947\u092a\u093e\u0932\u0940", im_t13n_or:"\u0b13\u0b21\u0b3c\u0b3f\u0b06", im_t13n_pa:"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40", im_t13n_ru:"P\u0443\u0441\u0441\u043a\u0438\u0439", 
im_t13n_sa:"\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d", im_t13n_sr:"C\u0440\u043f\u0441\u043a\u0438", im_t13n_si:"\u0dc3\u0dd2\u0d82\u0dc4\u0dbd", im_t13n_ta:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd", im_t13n_te:"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41", im_t13n_ti:"\u1275\u130d\u122d\u129b", im_t13n_ur:"\u0627\u0631\u062f\u0648", im_t13n_vi:"Ti\u1ebfng Vi\u1ec7t", vkd_ar:"\u0644\u0648\u062d\u0629 \u0645\u0641\u0627\u062a\u064a\u062d \u0627\u0644\u0644\u063a\u0629 \u0627\u0644\u0639\u0631\u0628\u064a\u0629", 
vkd_be:"\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f", vkd_bg:"\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438 \u0435\u0437\u0438\u043a", vkd_bg_phone:"\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438 \u0435\u0437\u0438\u043a(\u0444\u043e\u043d\u0435\u0442\u0438\u043a\u0430)", vkd_bn_inscript:"\u09ac\u09be\u0982\u09b2\u09be(INSCRIPT)", vkd_bn_phone:"\u09ac\u09be\u0982\u09b2\u09be(\u09ab\u09cb\u09a8\u09c7\u099f\u09bf\u0995)", vkd_bs:"bosanski", vkd_ca:"catal\u00e0", vkd_chr:"\u13e3\u13b3\u13a9", 
vkd_cs:"\u010de\u0161tina", vkd_cs_qwertz:"\u010de\u0161tina QWERTZ", vkd_da:"dansk", vkd_de:"Deutsch", vkd_de_ch:"Deutschsprachige Schweiz", vkd_deva_phone:"\u0926\u0947\u0935\u0928\u093e\u0917\u0930\u0940(\u092b\u094b\u0928\u0947\u091f\u093f\u0915)", vkd_el:"\u03b5\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac", vkd_en:"English Keyboard", vkd_es_es:"espa\u00f1ol", vkd_et:"eesti keel", vkd_ethi:"\u130d\u12d5\u12dd", vkd_eu:"Euskara", vkd_fa:"\u0641\u0627\u0631\u0633\u06cc", vkd_fi:"suomi", vkd_fr:"fran\u00e7ais", 
vkd_gl:"Galego", vkd_gu_inscript:"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0(INSCRIPT)", vkd_gu_phone:"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0(\u0aab\u0acb\u0aa8\u0ac7\u0aa4\u0abf\u0a95)", vkd_guru_inscript:"\u0a17\u0a41\u0a30\u0a2e\u0a41\u0a16\u0a40(INSCRIPT)", vkd_guru_phone:"\u0a17\u0a41\u0a30\u0a2e\u0a41\u0a16\u0a40(\u0a2b\u0a4b\u0a28\u0a47\u0a1f\u0a3f\u0a15)", vkd_iw:"\u05e2\u05b4\u05d1\u05b0\u05e8\u05b4\u05d9\u05ea", vkd_he:"\u05e2\u05b4\u05d1\u05b0\u05e8\u05b4\u05d9\u05ea", vkd_hi:"\u0939\u093f\u0902\u0926\u0940", 
vkd_hr:"hrvatski", vkd_hu_101:"magyar nyelv(101)", vkd_hy_east:"\u0531\u0580\u0587\u0565\u056c\u0561\u0570\u0561\u0575\u0565\u0580\u0565\u0576", vkd_hy_west:"\u0531\u0580\u0565\u0582\u0574\u057f\u0561\u0570\u0561\u0575\u0565\u0580\u0567\u0576", vkd_is:"\u00edslenska", vkd_it:"italiano", vkd_ka_qwerty:"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8 (\u10e5\u10ec\u10d4\u10e0\u10e2\u10e7)", vkd_ka_typewriter:"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8 (\u10e1\u10d0\u10d1\u10d4\u10ed\u10d3\u10d8 \u10db\u10d0\u10dc\u10e5\u10d0\u10dc\u10d0)", 
vkd_kk:"\u049a\u0430\u0437\u0430\u049b", vkd_km:"\u17a2\u1780\u17d2\u179f\u179a\u1781\u17d2\u1798\u17c2\u179a NiDA", vkd_ko:"\ud55c\uad6d\uc5b4", vkd_kn_inscript:"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1(INSCRIPT)", vkd_kn_phone:"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1(\u0cab\u0cca\u0ca8\u0cc6\u0c9f\u0cbf\u0c95\u0ccd)", vkd_ky_cyrl:"\u041a\u044b\u0440\u0433\u044b\u0437", vkd_latn_002:"Africa Latin", vkd_lo:"\u0e9e\u0eb2\u0eaa\u0eb2\u0ea5\u0eb2\u0ea7", vkd_lt:"lietuvi\u0173 kalba", vkd_lv:"latvie\u0161u valoda", vkd_mi:"M\u0101ori", 
vkd_mk:"\u043c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438", vkd_ml_inscript:"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02(INSCRIPT)", vkd_ml_phone:"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02(\u0d2b\u0d4a\u0d23\u0d31\u0d4d\u0d31\u0d3f\u0d15\u0d4d)", vkd_mn_cyrl:"\u041c\u043e\u043d\u0433\u043e\u043b", vkd_mt:"Malti", vkd_nl:"Nederlands", vkd_no:"norsk", vkd_or_inscript:"\u0b13\u0b21\u0b3c\u0b3f\u0b06(INSCRIPT)", vkd_or_phone:"\u0b13\u0b21\u0b3c\u0b3f\u0b06(\u0b2b\u0b4b\u0b28\u0b47\u0b1f\u0b3f\u0b15)", 
vkd_pl:"polski", vkd_prs:"\u0641\u0627\u0631\u0633\u06cc \u062f\u0631\u06cc", vkd_ps:"\u067e\u069a\u062a\u0648", vkd_pt_br:"portugu\u00eas brasileiro", vkd_ro:"rom\u00e2n\u0103", vkd_ro_sr13392_primary:"rom\u00e2n\u0103 SR13392 Primary", vkd_ro_sr13392_secondary:"rom\u00e2n\u0103 SR13392 Secondary", vkd_pt_pt:"portugu\u00eas europeu", vkd_rom:"rromani \u0107hib", vkd_ru:"\u0420\u0443\u0441\u0441\u043a\u0430\u044f \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0430", vkd_sa_phone:"\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d(\u092b\u094b\u0928\u0947\u091f\u093f\u0915)", 
vkd_si:"\u0dc1\u0dd4\u0daf\u0dca\u0db0 \u0dc3\u0dd2\u0d82\u0dc4\u0dbd SLS1134", vkd_sk:"slovensk\u00fd jazyk", vkd_sk_qwerty:"slovensk\u00fd jazyk - QWERTY", vkd_sl:"sloven\u0161\u010dina", vkd_sq:"shqip", vkd_srp:"Crnogorski jezik", vkd_sr_cyrl:"\u0421\u0440\u043f\u0441\u043a\u0438", vkd_sr_latn:"Srpski", vkd_sv:"svenska", vkd_ta_tamil99:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd(TAMIL99)", vkd_ta_inscript:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd(INSCRIPT)", vkd_ta_phone:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd(\u0baa\u0bcb\u0ba9\u0bc6\u0b9f\u0bbf\u0b95\u0bcd)", 
vkd_te_inscript:"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41(INSCRIPT)", vkd_te_phone:"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41(\u0c2b\u0c4b\u0c28\u0c46\u0c1f\u0c3f\u0c15\u0c4d)", vkd_th:"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22", vkd_tr_f:"T\u00fcrk\u00e7e - F", vkd_tr_q:"T\u00fcrk\u00e7e - Q", vkd_tt:"\u0422\u0430\u0442\u0430\u0440", vkd_ug:"\u0626\u06c7\u064a\u063a\u06c7\u0631\u0686\u06d5", vkd_uk_101:"\u0443\u043a\u0440\u0430\u0457\u0301\u043d\u0441\u044c\u043a\u0430 \u043c\u043e\u0301\u0432\u0430(101)", 
vkd_ur:"\u0627\u0631\u062f\u0648", vkd_uz_latn:"O\u2018zbek", vkd_uz_cyrl_phone:"\u040e\u0437\u0431\u0435\u043a(\u0444\u043e\u043d\u0435\u0442\u0438\u0447\u043d\u0456)", vkd_uz_cyrl_type:"\u040e\u0437\u0431\u0435\u043a(\u0420\u043e\u0441\u0456\u0439\u0441\u044c\u043a\u0430)", vkd_uzs:"Southern Uzbek", vkd_vi_tcvn:"Ti\u1ebfng Vi\u1ec7t TCVN 6064", vkd_vi_telex:"Ti\u1ebfng Vi\u1ec7t Telex", vkd_vi_viqr:"Ti\u1ebfng Vi\u1ec7t VIQR"};
goog.ime.api.ita.InputToolInfo.isValid = function $goog$ime$api$ita$InputToolInfo$isValid$(inputTool) {
  return!!goog.ime.lang.InputTool.get(inputTool)
};
goog.ime.api.ita.InputToolInfo.getConfiguration = function $goog$ime$api$ita$InputToolInfo$getConfiguration$(inputToolCode) {
  var inputTool = goog.ime.lang.InputTool.get(inputToolCode);
  if(!inputTool) {
    return null
  }
  switch(inputTool.type) {
    case goog.ime.lang.InputToolType.KBD:
      return{layoutCode:inputTool.layoutCode};
    case goog.ime.lang.InputToolType.IME:
      return{target:inputTool.languageCode}
  }
  return null
};
goog.ime.api.ita.InputToolInfo.isKeyboard = function $goog$ime$api$ita$InputToolInfo$isKeyboard$(inputToolCode) {
  var inputTool = goog.ime.lang.InputTool.get(inputToolCode);
  return!!inputTool && inputTool.type == goog.ime.lang.InputToolType.KBD
};
goog.ime.api.ita.KennedyMenu = function $goog$ime$api$ita$KennedyMenu$(inputToolMgr, evtTarget) {
  this.inputToolManager_ = inputToolMgr;
  this.eventTarget_ = evtTarget;
  this.inputToolMenuItemMap_ = {};
  this.iconButtons_ = [];
  this.hoverElements_ = [];
  goog.ime.api.ita.AbstractMenu.call(this)
};
goog.inherits(goog.ime.api.ita.KennedyMenu, goog.ime.api.ita.AbstractMenu);
goog.ime.api.ita.KennedyMenu.prototype.inputToolsDiv_ = null;
goog.ime.api.ita.KennedyMenu.prototype.inputToolIcon_ = null;
goog.ime.api.ita.KennedyMenu.prototype.inputToolIconBtn_ = null;
goog.ime.api.ita.KennedyMenu.prototype.dropdownArrowBtn_ = null;
goog.ime.api.ita.KennedyMenu.prototype.dropdownArrowImg_ = null;
goog.ime.api.ita.KennedyMenu.prototype.dropdownMenu_ = null;
goog.ime.api.ita.KennedyMenu.prototype.floatingBar_ = null;
goog.ime.api.ita.KennedyMenu.prototype.floatingImg_ = null;
goog.ime.api.ita.KennedyMenu.prototype.reposition = function $goog$ime$api$ita$KennedyMenu$$reposition$(anchor, position, opt_margin) {
  goog.ime.api.ita.KennedyMenu.superClass_.reposition.call(this, anchor, position, opt_margin);
  this.positionDropdownMenu_()
};
goog.ime.api.ita.KennedyMenu.prototype.createDom = function $goog$ime$api$ita$KennedyMenu$$createDom$() {
  goog.ime.api.ita.KennedyMenu.superClass_.createDom.call(this);
  var containerElement = this.getElement(), domHelper = this.getDomHelper();
  containerElement.style.zIndex = "" + (goog.ime.api.ita.MAX_INT - 3);
  this.inputToolsDiv_ = domHelper.createDom("span", {"class":goog.ime.api.ita.KennedyMenu.CSS.INPUT_TOOLS_DIV});
  domHelper.appendChild(containerElement, this.inputToolsDiv_);
  var enabled = this.inputToolManager_.currentInputToolState;
  if(this.inputToolManager_.currentInputTool) {
    var iconButton = goog.ime.api.ita.KennedyMenu.createIconButton(this.getDomHelper(), this.inputToolManager_.currentInputTool, enabled, !this.isFloating && 0 == this.iconButtons_.length);
    goog.array.insert(this.hoverElements_, {el:iconButton.button, className:goog.ime.api.ita.KennedyMenu.CSS.ICON_BUTTON});
    domHelper.appendChild(this.inputToolsDiv_, iconButton.button);
    goog.array.insert(this.iconButtons_, iconButton.button);
    this.inputToolIconBtn_ = iconButton.button;
    this.inputToolIcon_ = iconButton.icon
  }
  this.createDropdownArrowBtn_();
  this.createDropdownMenu_()
};
goog.ime.api.ita.KennedyMenu.createIconButton = function $goog$ime$api$ita$KennedyMenu$createIconButton$(domHelper, inputTool, selected, isFirst) {
  var cssNS = goog.ime.api.ita.KennedyMenu.CSS, iconBtn = domHelper.createDom("a", {"class":cssNS.ICON_BUTTON + " " + cssNS.INPUT_TOOL_ICON + " " + cssNS.SMALL});
  isFirst ? goog.dom.classes.add(iconBtn, cssNS.LEFT) : goog.dom.classes.add(iconBtn, cssNS.MID);
  selected && goog.dom.classes.add(iconBtn, goog.ime.api.ita.KennedyMenu.CSS.SELECTED);
  var iconCss = goog.ime.api.ita.KennedyMenu.getInputToolIconCss(inputTool.code), icon = domHelper.createDom("span", {"class":cssNS.INPUT_TOOLS_SPRITE_IMG + " " + iconCss + " " + cssNS.ICON + " " + cssNS.ICON_SPAN});
  domHelper.appendChild(iconBtn, icon);
  return{button:iconBtn, icon:icon}
};
goog.ime.api.ita.KennedyMenu.prototype.createDropdownArrowBtn_ = function $goog$ime$api$ita$KennedyMenu$$createDropdownArrowBtn_$() {
  var cssNS = goog.ime.api.ita.KennedyMenu.CSS;
  if(2 > this.inputToolManager_.inputToolsInPage.length) {
    var iconButton = this.iconButtons_[this.iconButtons_.length - 1];
    goog.dom.classes.has(iconButton, cssNS.MID) ? (goog.dom.classes.remove(iconButton, cssNS.MID), goog.dom.classes.add(iconButton, cssNS.RIGHT)) : (goog.dom.classes.remove(iconButton, cssNS.LEFT), goog.dom.classes.add(iconButton, cssNS.SINGLE))
  }else {
    var domHelper = this.getDomHelper();
    this.dropdownArrowBtn_ = domHelper.createDom("a", {"class":cssNS.ICON_BUTTON + " " + cssNS.RIGHT + " " + cssNS.DROPDOWN});
    goog.array.insert(this.hoverElements_, {el:this.dropdownArrowBtn_, className:cssNS.ICON_BUTTON});
    this.dropdownArrowImg_ = domHelper.createDom("span", {"class":cssNS.INPUT_TOOLS_SPRITE_IMG + " " + cssNS.DROPDOWN_ARROW + " " + cssNS.ICON_SPAN});
    domHelper.appendChild(this.dropdownArrowBtn_, this.dropdownArrowImg_);
    domHelper.appendChild(this.inputToolsDiv_, this.dropdownArrowBtn_)
  }
};
goog.ime.api.ita.KennedyMenu.prototype.addFloatingBar = function $goog$ime$api$ita$KennedyMenu$$addFloatingBar$() {
  var domHelper = this.getDomHelper(), cssNS = goog.ime.api.ita.KennedyMenu.CSS;
  this.floatingBar_ = domHelper.createDom("a", {"class":cssNS.ICON_BUTTON + " " + cssNS.LEFT + " " + cssNS.FLOATING_BAR});
  goog.array.insert(this.hoverElements_, {el:this.floatingBar_, className:cssNS.ICON_BUTTON});
  this.floatingImg_ = domHelper.createDom("span", {"class":cssNS.INPUT_TOOLS_SPRITE_IMG + " " + cssNS.FLOATING_BAR_ICON + " " + cssNS.ICON_SPAN});
  domHelper.appendChild(this.floatingBar_, this.floatingImg_);
  goog.dom.insertChildAt(this.inputToolsDiv_, this.floatingBar_, 0);
  var dragger = new goog.fx.Dragger(this.getElement(), this.floatingBar_), self = this;
  dragger.addEventListener(goog.fx.Dragger.EventType.DRAG, function() {
    self.positionDropdownMenu_();
    self.setRepositionEnabled(!1)
  })
};
goog.ime.api.ita.KennedyMenu.prototype.createDropdownMenu_ = function $goog$ime$api$ita$KennedyMenu$$createDropdownMenu_$() {
  var domHelper = this.getDomHelper(), inputTools = this.inputToolManager_.inputToolsInPage;
  this.dropdownMenu_ = domHelper.createDom("ul", {"class":goog.ime.api.ita.KennedyMenu.CSS.DROPDOWN_MENU + this.maybeAddIECss_(), style:"position:absolute;"});
  var currentInputName = this.inputToolManager_.currentInputTool.code, enabled = this.inputToolManager_.currentInputToolState;
  goog.array.forEach(inputTools, function(inputTool) {
    var selected = currentInputName == inputTool.code && enabled, menuItem = this.createInputtoolMenuItem_(inputTool.code, selected);
    selected && this.selectElement_(menuItem);
    domHelper.appendChild(this.dropdownMenu_, menuItem)
  }, this);
  this.hideElement_(this.dropdownMenu_);
  domHelper.getDocument().body.appendChild(this.dropdownMenu_)
};
goog.ime.api.ita.KennedyMenu.prototype.createInputtoolMenuItem_ = function $goog$ime$api$ita$KennedyMenu$$createInputtoolMenuItem_$(inputTool) {
  var domHelper = this.getDomHelper(), cssNS = goog.ime.api.ita.KennedyMenu.CSS, menuItem = domHelper.createDom("li", {"class":cssNS.MENU_ITEM, style:'style="-webkit-user-select: none; "'});
  goog.array.insert(this.hoverElements_, {el:menuItem, className:cssNS.MENU_ITEM});
  var inputToolIcon = domHelper.createDom("span", {"class":cssNS.MENU_ITEM_INPUTTOOL_ICON + " " + cssNS.INPUT_TOOLS_SPRITE_IMG + " " + goog.ime.api.ita.KennedyMenu.getInputToolIconCss(inputTool)});
  domHelper.appendChild(menuItem, inputToolIcon);
  var inputToolName = domHelper.createDom("span", {"class":cssNS.MENU_ITEM_INPUTTOOL_NAME + " " + cssNS.MENU_ITEM_SPAN}, goog.ime.api.ita.InputToolInfo.INPUT_TOOL_NAME[inputTool]);
  domHelper.appendChild(menuItem, inputToolName);
  this.inputToolMenuItemMap_[inputTool] = {container:menuItem, icon:inputToolIcon};
  return menuItem
};
goog.ime.api.ita.KennedyMenu.getInputToolIconCss = function $goog$ime$api$ita$KennedyMenu$getInputToolIconCss$(inputTool) {
  var suffix;
  suffix = -1 != inputTool.indexOf("vkd") ? "vkd" : inputTool.substring(inputTool.indexOf("_") + 1);
  return goog.ime.api.ita.KennedyMenu.IM_CSS_MAP[suffix]
};
goog.ime.api.ita.KennedyMenu.ICON_HEIGHT = 15;
goog.ime.api.ita.KennedyMenu.prototype.resize = function $goog$ime$api$ita$KennedyMenu$$resize$(height) {
  height < goog.ime.api.ita.KennedyMenu.ICON_HEIGHT ? height = goog.ime.api.ita.KennedyMenu.ICON_HEIGHT : height > goog.ime.api.ita.KennedyMenu.HEIGHT && (height = goog.ime.api.ita.KennedyMenu.HEIGHT);
  var marginTop = Math.ceil((height - goog.ime.api.ita.KennedyMenu.ICON_HEIGHT) / 2), heightStr = height + "px", marginTopStr = marginTop + "px";
  this.floatingBar_.style.height = heightStr;
  this.dropdownArrowBtn_.style.height = heightStr;
  goog.array.forEach(this.iconButtons_, function(iconBtn) {
    iconBtn.button.style.height = heightStr
  });
  this.floatingImg_.style.marginTop = marginTopStr;
  this.dropdownArrowImg_.style.marginTop = marginTopStr;
  goog.array.forEach(this.iconButtons_, function(iconBtn) {
    iconBtn.icon.style.marginTop = marginTopStr
  })
};
goog.ime.api.ita.KennedyMenu.prototype.selectElement_ = function $goog$ime$api$ita$KennedyMenu$$selectElement_$(elem) {
  goog.dom.classes.add(elem, goog.ime.api.ita.KennedyMenu.CSS.SELECTED)
};
goog.ime.api.ita.KennedyMenu.prototype.deselectElement_ = function $goog$ime$api$ita$KennedyMenu$$deselectElement_$(elem) {
  goog.dom.classes.remove(elem, goog.ime.api.ita.KennedyMenu.CSS.SELECTED)
};
goog.ime.api.ita.KennedyMenu.prototype.showElement_ = function $goog$ime$api$ita$KennedyMenu$$showElement_$(elem, opt_display) {
  elem.style.display = opt_display ? opt_display : "block"
};
goog.ime.api.ita.KennedyMenu.prototype.hideElement_ = function $goog$ime$api$ita$KennedyMenu$$hideElement_$(elem) {
  elem.style.display = "none"
};
goog.ime.api.ita.KennedyMenu.prototype.maybeAddIECss_ = function $goog$ime$api$ita$KennedyMenu$$maybeAddIECss_$() {
  return goog.userAgent.IE ? " " + goog.ime.api.ita.KennedyMenu.CSS.IE : ""
};
goog.ime.api.ita.KennedyMenu.HEIGHT = 27;
goog.ime.api.ita.KennedyMenu.CSS = {DROPDOWN:"dropdown", DROPDOWN_ARROW:"ita-kd-arrow", DROPDOWN_MENU:"ita-kd-dropdown-menu", FLOATING_BAR:"floating-bar", FLOATING_BAR_ICON:"ita-kd-floating-bar-icon", ICON:"ita-kd-icon", ICON_BUTTON:"ita-kd-icon-button", ICON_SPAN:"ita-kd-icon-span", INPUT_TOOLS_DIV:"ita-kd-inputtools-div", INPUT_TOOLS_SPRITE_IMG:"ita-kd-img", INPUT_TOOL_ICON:"ita-kd-inputtool-icon", LEFT:"left", MENU_ITEM:"ita-kd-menuitem", MENU_ITEM_SPAN:"ita-kd-menuitem-span", MENU_ITEM_INPUTTOOL_ICON:"ita-kd-menuitem-inputtool-icon", 
MENU_ITEM_INPUTTOOL_NAME:"ita-kd-menuitem-inputtool-name", MID:"mid", MID2:"mid2", RIGHT:"right", SELECTED:"selected", SINGLE:"single", SMALL:"small", IE:"ie", DBC:"ita-kd-btn-dbc", SBC:"ita-kd-btn-sbc", ZH:"ita-kd-btn-zh", EN:"ita-kd-btn-en", EN_PUN:"ita-kd-btn-en_pun", ZH_PUN:"ita-kd-btn-zh_pun"};
goog.ime.api.ita.KennedyMenu.IM_CSS_MAP = {t13n_am:"ita-kd-t13n_am", t13n_ar:"ita-kd-t13n_ar", t13n_bn:"ita-kd-t13n_bn", t13n_el:"ita-kd-t13n_el", t13n_gu:"ita-kd-t13n_gu", t13n_hi:"ita-kd-t13n_hi", t13n_kn:"ita-kd-t13n_kn", t13n_ml:"ita-kd-t13n_ml", t13n_mr:"ita-kd-t13n_mr", t13n_ne:"ita-kd-t13n_ne", t13n_pa:"ita-kd-t13n_pa", t13n_ta:"ita-kd-t13n_ta", t13n_te:"ita-kd-t13n_te", t13n_ur:"ita-kd-t13n_ur", t13n_fa:"ita-kd-t13n_fa", t13n_sa:"ita-kd-t13n_sa", t13n_ru:"ita-kd-t13n_ru", t13n_sr:"ita-kd-t13n_sr", 
t13n_ti:"ita-kd-t13n_ti", pinyin_zh_hans:"ita-kd-pinyin", pinyin_zh_hant:"ita-kd-pinyin", wubi_zh_hans:"ita-kd-wubi_zh_hans", t13n_si:"ita-kd-t13n_si", t13n_or:"ita-kd-t13n_or", t13n_ja:"ita-kd-t13n_ja", t13n_he:"ita-kd-t13n_he", t13n_iw:"ita-kd-t13n_he", t13n_vi:"ita-kd-t13n_vi", zhuyin_zh_hant:"ita-kd-zhuyin_zh_hant", vkd:"ita-kd-vkd"};
goog.ime.api.ita.KennedyMenu.prototype.positionSelf = function $goog$ime$api$ita$KennedyMenu$$positionSelf$() {
  goog.ime.api.ita.AbstractMenu.goToBottomRight(this.getElement())
};
goog.ime.api.ita.KennedyMenu.prototype.handleInputtoolMenuItemMouseUp_ = function $goog$ime$api$ita$KennedyMenu$$handleInputtoolMenuItemMouseUp_$(inputTool) {
  this.dispatchEvent(new goog.ime.api.ita.MenuActionEvent(inputTool, !0));
  this.hideElement_(this.dropdownMenu_);
  this.dropdownMenuOpened = !1;
  this.redirectFocus()
};
goog.ime.api.ita.KennedyMenu.prototype.handleDropdownArrowClick_ = function $goog$ime$api$ita$KennedyMenu$$handleDropdownArrowClick_$() {
  "none" == this.dropdownMenu_.style.display ? (this.positionDropdownMenu_(), this.showElement_(this.dropdownMenu_), this.dropdownMenuOpened = !0) : (this.hideElement_(this.dropdownMenu_), this.dropdownMenuOpened = !1)
};
goog.ime.api.ita.KennedyMenu.prototype.positionDropdownMenu_ = function $goog$ime$api$ita$KennedyMenu$$positionDropdownMenu_$() {
  var position = new goog.positioning.AnchoredViewportPosition(this.getElement(), goog.positioning.Corner.BOTTOM_START, !0);
  this.hideElement_(this.dropdownMenu_);
  this.dropdownMenuOpened = !1;
  position.reposition(this.dropdownMenu_, goog.positioning.Corner.TOP_START, new goog.math.Box(1, 0, 0, 1))
};
goog.ime.api.ita.KennedyMenu.prototype.handleInputToolIconClick_ = function $goog$ime$api$ita$KennedyMenu$$handleInputToolIconClick_$() {
  var self = this;
  this.dispatchEvent(new goog.ime.api.ita.MenuActionEvent(self.inputToolManager_.currentInputTool.code, !self.inputToolManager_.currentInputToolState));
  this.redirectFocus()
};
goog.ime.api.ita.KennedyMenu.prototype.enterDocument = function $goog$ime$api$ita$KennedyMenu$$enterDocument$() {
  goog.ime.api.ita.KennedyMenu.superClass_.enterDocument.call(this);
  this.eventTarget_.addEventListener(goog.ime.api.ita.ControlEventType.CURRENT_INPUT_TOOL_CHANGED, this.onInputToolUpdated_, !1, this);
  this.eventTarget_.addEventListener(goog.ime.api.ita.ControlEventType.INPUT_TOOL_LIST_UPDATED, this.onInputToolListUpdated_, !1, this);
  goog.events.listen(this.inputToolIconBtn_, goog.events.EventType.CLICK, this.handleInputToolIconClick_, !1, this);
  goog.events.listen(this.inputToolIconBtn_, goog.events.EventType.DBLCLICK, this.handleInputToolIconClick_, !1, this);
  if(this.dropdownArrowBtn_ && (goog.events.listen(this.dropdownArrowBtn_, goog.events.EventType.MOUSEUP, this.handleDropdownArrowClick_, !1, this), this.dropdownMenu_)) {
    var inputTools = this.inputToolManager_.inputToolsInPage;
    goog.array.forEach(goog.dom.getChildren(this.dropdownMenu_), function(menuItem, index) {
      goog.events.listen(menuItem, goog.events.EventType.MOUSEUP, goog.bind(this.handleInputtoolMenuItemMouseUp_, this, inputTools[index].code))
    }, this)
  }
  goog.array.forEach(this.hoverElements_, function(item) {
    goog.ime.ui.Hover.addHover(item.el, item.className)
  })
};
goog.ime.api.ita.KennedyMenu.prototype.onInputToolUpdated_ = function $goog$ime$api$ita$KennedyMenu$$onInputToolUpdated_$(e) {
  var enabled = e.currInputToolActive, newInputTool = e.currInputToolName;
  newInputTool || (newInputTool = this.inputToolManager_.currentInputTool.code);
  var inputTools = this.inputToolManager_.inputToolsInPage;
  goog.array.forEach(inputTools, function(inputTool) {
    this.deselectElement_(this.inputToolMenuItemMap_[inputTool.code].container);
    goog.dom.classes.remove(this.inputToolIcon_, goog.ime.api.ita.KennedyMenu.getInputToolIconCss(inputTool.code))
  }, this);
  goog.dom.classes.add(this.inputToolIcon_, goog.ime.api.ita.KennedyMenu.getInputToolIconCss(newInputTool));
  enabled ? (this.selectElement_(this.inputToolMenuItemMap_[newInputTool].container), this.selectElement_(this.inputToolIconBtn_)) : this.deselectElement_(this.inputToolIconBtn_)
};
goog.ime.api.ita.KennedyMenu.prototype.onInputToolListUpdated_ = function $goog$ime$api$ita$KennedyMenu$$onInputToolListUpdated_$() {
  this.removeAllListener_();
  var elem = this.getElement();
  this.getDomHelper().removeNode(this.dropdownMenu_);
  0 < this.inputToolManager_.inputToolsInPage.length ? (this.setElementInternal(null), this.renderSelf(this.isFloating, this.container), this.reposition(elem, [goog.positioning.Corner.TOP_LEFT, goog.positioning.Corner.TOP_LEFT])) : this.eventTarget_.addEventListener(goog.ime.api.ita.ControlEventType.INPUT_TOOL_LIST_UPDATED, this.onInputToolListUpdated_, !1, this);
  this.getDomHelper().removeNode(elem)
};
goog.ime.api.ita.KennedyMenu.prototype.disposeInternal = function $goog$ime$api$ita$KennedyMenu$$disposeInternal$() {
  goog.ime.api.ita.KennedyMenu.superClass_.disposeInternal.call(this);
  this.removeAllListener_()
};
goog.ime.api.ita.KennedyMenu.prototype.removeAllListener_ = function $goog$ime$api$ita$KennedyMenu$$removeAllListener_$() {
  this.eventTarget_.removeEventListener(goog.ime.api.ita.ControlEventType.CURRENT_INPUT_TOOL_CHANGED, this.onInputToolUpdated_, !1, this);
  this.eventTarget_.removeEventListener(goog.ime.api.ita.ControlEventType.INPUT_TOOL_LIST_UPDATED, this.onInputToolListUpdated_, !1, this);
  goog.events.removeAll(this.inputToolIconBtn_);
  this.dropdownArrowBtn_ && (goog.events.removeAll(this.dropdownArrowBtn_), this.dropdownMenu_ && goog.array.forEach(goog.dom.getChildren(this.dropdownMenu_), function(menuItem) {
    goog.events.removeAll(menuItem)
  }));
  goog.array.forEach(this.hoverElements_, function(item) {
    goog.ime.ui.Hover.removeHover(item.el, item.className)
  })
};
goog.ime.api.ita.StatusBarButton = function $goog$ime$api$ita$StatusBarButton$(eventTarget, commandType, cssNames, opt_defaultCssName) {
  goog.ui.Component.call(this);
  this.eventTarget_ = eventTarget;
  this.commandType_ = commandType;
  this.cssNames_ = cssNames;
  this.defaultCssName_ = opt_defaultCssName && goog.array.contains(cssNames, opt_defaultCssName) ? opt_defaultCssName : this.cssNames_[0]
};
goog.inherits(goog.ime.api.ita.StatusBarButton, goog.ui.Component);
goog.ime.api.ita.StatusBarButton.createButton = function $goog$ime$api$ita$StatusBarButton$createButton$(eventTarget, commandType) {
  switch(commandType) {
    case goog.ime.plugin.CommandType.TOGGLE_LANGUAGE:
      return new goog.ime.api.ita.StatusBarButton(eventTarget, commandType, [goog.ime.api.ita.KennedyMenu.CSS.EN, goog.ime.api.ita.KennedyMenu.CSS.ZH], goog.ime.api.ita.KennedyMenu.CSS.ZH);
    case goog.ime.plugin.CommandType.TOGGLE_SBC:
      return new goog.ime.api.ita.StatusBarButton(eventTarget, commandType, [goog.ime.api.ita.KennedyMenu.CSS.DBC, goog.ime.api.ita.KennedyMenu.CSS.SBC], goog.ime.api.ita.KennedyMenu.CSS.SBC);
    case goog.ime.plugin.CommandType.PUNCTUATION:
      return new goog.ime.api.ita.StatusBarButton(eventTarget, commandType, [goog.ime.api.ita.KennedyMenu.CSS.EN_PUN, goog.ime.api.ita.KennedyMenu.CSS.ZH_PUN], goog.ime.api.ita.KennedyMenu.CSS.ZH_PUN);
    default:
      return null
  }
};
goog.ime.api.ita.StatusBarButton.prototype.createDom = function $goog$ime$api$ita$StatusBarButton$$createDom$() {
  goog.ime.api.ita.StatusBarButton.superClass_.createDom.call(this);
  var css = goog.ime.api.ita.KennedyMenu.CSS, a = goog.dom.createDom("a", {"class":css.ICON_BUTTON + " " + css.INPUT_TOOL_ICON + " " + css.MID2 + " " + css.SMALL}), icon = goog.dom.createDom("span", {"class":css.INPUT_TOOLS_SPRITE_IMG + " " + css.ICON + " " + css.ICON_SPAN + " " + this.defaultCssName_});
  goog.dom.appendChild(a, icon);
  this.setElementInternal(a)
};
goog.ime.api.ita.StatusBarButton.prototype.enterDocument = function $goog$ime$api$ita$StatusBarButton$$enterDocument$() {
  goog.ime.api.ita.StatusBarButton.superClass_.enterDocument.call(this);
  var element = this.getElement();
  goog.events.listen(element, goog.events.EventType.CLICK, this.onClick_, !1, this);
  this.eventTarget_.addEventListener(goog.ime.api.ita.ControlEventType.STATUS_BAR, this.onStatusChange_, !1, this);
  element && goog.ime.ui.Hover.addHover(element, goog.ime.api.ita.KennedyMenu.CSS.ICON_BUTTON)
};
goog.ime.api.ita.StatusBarButton.prototype.onClick_ = function $goog$ime$api$ita$StatusBarButton$$onClick_$() {
  var event = {type:goog.ime.api.ita.ControlEventType.EXECUTE_COMMAND, command:this.commandType_};
  this.eventTarget_.dispatchEvent(event)
};
goog.ime.api.ita.StatusBarButton.prototype.onStatusChange_ = function $goog$ime$api$ita$StatusBarButton$$onStatusChange_$(e) {
  var element = this.getElement();
  e.commandType == this.commandType_ && (goog.dom.classes.remove(element.firstChild, e.value ? this.cssNames_[0] : this.cssNames_[1]), goog.dom.classes.add(element.firstChild, e.value ? this.cssNames_[1] : this.cssNames_[0]))
};
goog.ime.api.ita.StatusBarButton.prototype.disposeInternal = function $goog$ime$api$ita$StatusBarButton$$disposeInternal$() {
  var element = this.getElement();
  element && goog.ime.ui.Hover.removeHover(element, goog.ime.api.ita.KennedyMenu.CSS.ICON_BUTTON);
  this.eventTarget_.removeEventListener(goog.ime.api.ita.ControlEventType.STATUS_BAR, this.onStatusChange_, !1, this);
  goog.events.removeAll(element);
  goog.ime.api.ita.StatusBarButton.superClass_.disposeInternal.call(this)
};
goog.ime.api.ita.StatusBar = function $goog$ime$api$ita$StatusBar$(inputToolMgr, eventTarget) {
  goog.ui.Component.call(this);
  this.inputToolManager_ = inputToolMgr;
  this.eventTarget_ = eventTarget;
  this.statusButtons_ = {}
};
goog.inherits(goog.ime.api.ita.StatusBar, goog.ui.Component);
goog.ime.api.ita.StatusBar.Z_INDEX = 2147483644;
goog.ime.api.ita.StatusBar.prototype.createDom = function $goog$ime$api$ita$StatusBar$$createDom$() {
  goog.ime.api.ita.StatusBar.superClass_.createDom.call(this);
  var dom = this.getDomHelper(), statusBarDiv_ = dom.createDom("span", {"class":goog.ime.api.ita.KennedyMenu.CSS.INPUT_TOOLS_DIV});
  statusBarDiv_.style.zIndex = "" + goog.ime.api.ita.StatusBar.Z_INDEX;
  var element = this.getElement();
  dom.appendChild(element, statusBarDiv_);
  goog.style.setStyle(element, {position:"absolute"})
};
goog.ime.api.ita.StatusBar.prototype.enterDocument = function $goog$ime$api$ita$StatusBar$$enterDocument$() {
  goog.ime.api.ita.StatusBar.superClass_.enterDocument.call(this);
  this.eventTarget_.addEventListener(goog.ime.api.ita.ControlEventType.CURRENT_INPUT_TOOL_CHANGED, this.updateStatusBar_, !1, this)
};
goog.ime.api.ita.StatusBar.prototype.createButtonByInputTool_ = function $goog$ime$api$ita$StatusBar$$createButtonByInputTool_$(inputTool) {
  if(!this.statusButtons_[inputTool.code]) {
    var elements = {}, commandTypes;
    switch(inputTool.code) {
      case goog.ime.lang.InputToolCode.INPUTMETHOD_PINYIN_CHINESE_SIMPLIFIED:
      ;
      case goog.ime.lang.InputToolCode.INPUTMETHOD_PINYIN_CHINESE_TRADITIONAL:
      ;
      case goog.ime.lang.InputToolCode.INPUTMETHOD_ZHUYIN_CHINESE_TRADITIONAL:
      ;
      case goog.ime.lang.InputToolCode.INPUTMETHOD_WUBI_CHINESE_SIMPLIFIED:
        commandTypes = [goog.ime.plugin.CommandType.TOGGLE_LANGUAGE, goog.ime.plugin.CommandType.TOGGLE_SBC, goog.ime.plugin.CommandType.PUNCTUATION]
    }
    commandTypes && (goog.array.forEach(commandTypes, function(commandType) {
      var button = goog.ime.api.ita.StatusBarButton.createButton(this.eventTarget_, commandType);
      button.createDom();
      button.enterDocument();
      elements[commandType] = button
    }, this), this.statusButtons_[inputTool.code] = elements)
  }
};
goog.ime.api.ita.StatusBar.prototype.updateStatusBar_ = function $goog$ime$api$ita$StatusBar$$updateStatusBar_$() {
  var dom = this.getDomHelper(), element = this.getElement(), container = element.firstChild;
  dom.removeChildren(container);
  this.draggerForIME_ && this.draggerForIME_.dispose();
  this.draggerForFloatingBar_ && this.draggerForFloatingBar_.dispose();
  var inputTool = this.inputToolManager_.currentInputTool;
  if(inputTool) {
    this.createButtonByInputTool_(inputTool);
    var elements = this.statusButtons_[inputTool.code];
    goog.object.forEach(elements, function(btn) {
      btn.createDom();
      btn.enterDocument();
      dom.appendChild(container, btn.getElement())
    }, this);
    if(0 < goog.dom.getChildren(container).length) {
      var iconButtonMap = goog.ime.api.ita.KennedyMenu.createIconButton(this.getDomHelper(), inputTool, !1, !1);
      this.inputToolButton_ = iconButtonMap.button;
      goog.style.setStyle(this.inputToolButton_, {cursor:"move"});
      goog.dom.insertChildAt(container, iconButtonMap.button, 0);
      goog.dom.classes.remove(container.lastChild, goog.ime.api.ita.KennedyMenu.CSS.MID2);
      goog.dom.classes.add(container.lastChild, "right");
      this.draggerForIME_ = new goog.fx.Dragger(element, this.inputToolButton_);
      this.addFloatingBar();
      goog.ime.api.ita.AbstractMenu.goToBottomRight(element)
    }
  }
};
goog.ime.api.ita.StatusBar.prototype.addFloatingBar = function $goog$ime$api$ita$StatusBar$$addFloatingBar$() {
  var domHelper = this.getDomHelper(), cssNS = goog.ime.api.ita.KennedyMenu.CSS;
  this.floatingBar_ = domHelper.createDom("a", {"class":cssNS.ICON_BUTTON + " " + cssNS.LEFT + " " + cssNS.FLOATING_BAR});
  var floatingImg = domHelper.createDom("span", {"class":cssNS.INPUT_TOOLS_SPRITE_IMG + " " + cssNS.FLOATING_BAR_ICON + " " + cssNS.ICON_SPAN});
  domHelper.appendChild(this.floatingBar_, floatingImg);
  goog.dom.insertChildAt(this.getElement().firstChild, this.floatingBar_, 0);
  this.draggerForFloatingBar_ = new goog.fx.Dragger(this.getElement(), this.floatingBar_)
};
goog.ime.api.ita.StatusBar.prototype.disposeInternal = function $goog$ime$api$ita$StatusBar$$disposeInternal$() {
  this.draggerForFloatingBar_ && this.draggerForFloatingBar_.dispose();
  this.draggerForIME_ && this.draggerForIME_.dispose();
  goog.object.forEach(this.statusButtons_, function(value) {
    goog.array.forEach(value, function(button) {
      button.dispose()
    })
  });
  this.eventTarget_.removeEventListener(goog.ime.api.ita.ControlEventType.CURRENT_INPUT_TOOL_CHANGED, this.updateStatusBar_, !1, this)
};
goog.ime.api.ita.InputToolsController = function $goog$ime$api$ita$InputToolsController$(opt_config) {
  this.pageElements_ = [];
  this.eventTarget_ = new goog.events.EventTarget;
  this.inputToolManager_ = new goog.ime.api.ita.InputToolManager;
  this.eventRegister = new goog.events.EventHandler(this);
  this.inputMethod_ = new goog.ime.api.ita.InputMethod(this.eventTarget_, opt_config);
  this.obsoletePageElements_ = [];
  this.eventTarget_.addEventListener(goog.ime.plugin.keyboard.EventType.CLOSE_KEYBOARD, this.onKeyboardActionHandler_, !1, this);
  if(!opt_config || opt_config.showStatusBar) {
    this.statusBar_ = new goog.ime.api.ita.StatusBar(this.inputToolManager_, this.eventTarget_), this.statusBar_.render()
  }
  this.eventTarget_.addEventListener(goog.ime.api.ita.ControlEventType.EXECUTE_COMMAND, this.onExecuteCommand_, !1, this);
  this.eventTarget_.addEventListener(goog.events.EventType.FOCUS, this.onFocus_, !1, this)
};
goog.inherits(goog.ime.api.ita.InputToolsController, goog.Disposable);
goog.ime.api.ita.InputToolsController.BUILD_SOURCE = "jsapi";
goog.ime.api.ita.InputToolsController.prototype.raiseError_ = function $goog$ime$api$ita$InputToolsController$$raiseError_$(methodName, message) {
  throw Error("Exception in " + methodName + ": " + message);
};
goog.ime.api.ita.InputToolsController.UI = {KENNEDY:"kd"};
goog.ime.api.ita.InputToolsController.prototype.notifyInputToolsUpdated_ = function $goog$ime$api$ita$InputToolsController$$notifyInputToolsUpdated_$() {
  this.eventTarget_.dispatchEvent({type:goog.ime.api.ita.ControlEventType.INPUT_TOOL_LIST_UPDATED, inputTools:this.inputToolManager_.inputToolsInPage})
};
goog.ime.api.ita.InputToolsController.prototype.notifyPageElementsUpdated_ = function $goog$ime$api$ita$InputToolsController$$notifyPageElementsUpdated_$() {
  this.eventTarget_.dispatchEvent({type:goog.ime.api.ita.ControlEventType.PAGE_ELEMENT_LIST_UPDATED, elements:this.pageElements_})
};
goog.ime.api.ita.InputToolsController.prototype.addInputTools = function $goog$ime$api$ita$InputToolsController$$addInputTools$(inputToolCode$$0) {
  var itm = this.inputToolManager_, array = [];
  goog.array.extend(array, inputToolCode$$0);
  goog.array.forEach(array, function(inputToolCode) {
    var inputTool = goog.ime.lang.InputTool.get(inputToolCode);
    inputTool && (inputTool.type == goog.ime.lang.InputToolType.KBD && this.inputMethod_.execCommand(goog.ime.plugin.CommandType.LOAD_LAYOUT, inputTool.layoutCode), goog.array.insert(itm.inputToolsInPage, inputTool))
  }, this);
  !itm.currentInputTool && 0 < itm.inputToolsInPage.length && (itm.currentInputTool = itm.inputToolsInPage[0]);
  this.updatePageInputtools_();
  this.notifyInputToolsUpdated_()
};
goog.ime.api.ita.InputToolsController.prototype.removeInputTools = function $goog$ime$api$ita$InputToolsController$$removeInputTools$(inputToolCode$$0) {
  var itm = this.inputToolManager_, array = [];
  goog.array.extend(array, inputToolCode$$0);
  goog.array.forEach(array, function(inputToolCode) {
    var inputTool = goog.ime.lang.InputTool.get(inputToolCode);
    inputTool == itm.currentInputTool && (itm.currentInputTool = null, itm.currentInputToolState = !1);
    goog.array.remove(itm.inputToolsInPage, inputTool)
  }, this);
  !itm.currentInputTool && 0 < itm.inputToolsInPage.length && (itm.currentInputTool = itm.inputToolsInPage[0]);
  this.updatePageInputtools_();
  this.notifyInputToolsUpdated_()
};
goog.ime.api.ita.InputToolsController.prototype.setInputTools = function $goog$ime$api$ita$InputToolsController$$setInputTools$(inputToolCode) {
  var array = [];
  goog.array.extend(array, inputToolCode);
  goog.array.clear(this.inputToolManager_.inputToolsInPage);
  this.inputToolManager_.currentInputTool && !goog.array.contains(array, this.inputToolManager_.currentInputTool.code) && (this.inputToolManager_.currentInputTool = null, this.inputToolManager_.currentInputToolState = !1);
  this.addInputTools(array)
};
goog.ime.api.ita.InputToolsController.prototype.addPageElements = function $goog$ime$api$ita$InputToolsController$$addPageElements$(element$$0) {
  var elements = [];
  goog.array.extend(elements, element$$0);
  goog.array.forEach(elements, function(element) {
    var elem = goog.dom.getElement(element);
    elem && goog.array.insert(this.pageElements_, elem)
  }, this);
  this.updatePageInputtools_();
  this.notifyPageElementsUpdated_()
};
goog.ime.api.ita.InputToolsController.prototype.removePageElements = function $goog$ime$api$ita$InputToolsController$$removePageElements$(element$$0) {
  var elements = [];
  goog.array.extend(elements, element$$0);
  this.obsoletePageElements_ = [];
  goog.array.forEach(elements, function(element) {
    var elem = goog.dom.getElement(element);
    elem && (goog.array.remove(this.pageElements_, elem), goog.array.insert(this.obsoletePageElements_, elem))
  }, this);
  this.updatePageInputtools_();
  this.notifyPageElementsUpdated_();
  this.obsoletePageElements_ = []
};
goog.ime.api.ita.InputToolsController.prototype.setPageElements = function $goog$ime$api$ita$InputToolsController$$setPageElements$(element$$0) {
  var elements = [];
  goog.array.extend(elements, element$$0);
  this.obsoletePageElements_ = this.pageElements_;
  this.pageElements_ = [];
  goog.array.forEach(elements, function(element) {
    var elem = goog.dom.getElement(element);
    elem && (goog.array.insert(this.pageElements_, elem), goog.array.remove(this.obsoletePageElements_, elem))
  }, this);
  this.updatePageInputtools_();
  this.notifyPageElementsUpdated_();
  this.obsoletePageElements_ = []
};
goog.ime.api.ita.InputToolsController.prototype.updatePageInputtools_ = function $goog$ime$api$ita$InputToolsController$$updatePageInputtools_$() {
  goog.array.isEmpty(this.pageElements_) || this.inputMethod_.register(this.pageElements_);
  goog.array.isEmpty(this.obsoletePageElements_) || this.inputMethod_.unregister(this.obsoletePageElements_);
  this.inputMethod_.activateInputTool(this.inputToolManager_.currentInputTool, this.inputToolManager_.currentInputToolState)
};
goog.ime.api.ita.InputToolsController.prototype.activateInputTool_ = function $goog$ime$api$ita$InputToolsController$$activateInputTool_$(enabled, inputTool) {
  if(!enabled || goog.ime.lang.InputTool.get(inputTool.code)) {
    this.inputMethod_.activateInputTool(inputTool, enabled), this.inputToolManager_.currentInputTool = inputTool, this.inputToolManager_.currentInputToolState = enabled, this.eventTarget_.dispatchEvent({type:goog.ime.api.ita.ControlEventType.CURRENT_INPUT_TOOL_CHANGED, prevInputToolName:this.inputToolManager_.currentInputTool.code, prevInputToolActive:this.inputToolManager_.currentInputToolState, currInputToolName:inputTool.code, currInputToolActive:enabled})
  }
};
goog.ime.api.ita.InputToolsController.prototype.activateInputTool = function $goog$ime$api$ita$InputToolsController$$activateInputTool$(inputToolCode) {
  var inputTool = goog.ime.lang.InputTool.get(inputToolCode);
  inputTool && (goog.array.contains(this.inputToolManager_.inputToolsInPage, inputTool) || this.addInputTools(inputTool.code), this.activateInputTool_(!0, inputTool))
};
goog.ime.api.ita.InputToolsController.prototype.enableCurrentInputTool = function $goog$ime$api$ita$InputToolsController$$enableCurrentInputTool$() {
  this.inputToolManager_.currentInputTool && this.activateInputTool_(!0, this.inputToolManager_.currentInputTool)
};
goog.ime.api.ita.InputToolsController.prototype.disableCurrentInputTool = function $goog$ime$api$ita$InputToolsController$$disableCurrentInputTool$() {
  this.inputToolManager_.currentInputTool && this.activateInputTool_(!1, this.inputToolManager_.currentInputTool)
};
goog.ime.api.ita.InputToolsController.prototype.toggleCurrentInputTool = function $goog$ime$api$ita$InputToolsController$$toggleCurrentInputTool$() {
  this.inputToolManager_.currentInputTool && this.activateInputTool_(!this.inputToolManager_.currentInputToolState, this.inputToolManager_.currentInputTool)
};
goog.ime.api.ita.InputToolsController.prototype.addEventListener = function $goog$ime$api$ita$InputToolsController$$addEventListener$(type, listener, opt_listenerScope) {
  goog.object.containsValue(goog.ime.api.ita.ControlEventType, type) || this.raiseError_("addEventListener", "Invalid event type:" + type);
  this.eventTarget_.addEventListener(type, listener, !1, opt_listenerScope)
};
goog.ime.api.ita.InputToolsController.prototype.removeEventListener = function $goog$ime$api$ita$InputToolsController$$removeEventListener$(type, listener, opt_listenerScope) {
  goog.object.containsValue(goog.ime.api.ita.ControlEventType, type) || this.raiseError_("removeEventListener", "Invalid event type:" + type);
  this.eventTarget_.removeEventListener(type, listener, !1, opt_listenerScope)
};
goog.ime.api.ita.InputToolsController.prototype.onTiaMenuAction_ = function $goog$ime$api$ita$InputToolsController$$onTiaMenuAction_$(e) {
  this.activateInputTool_(e.getEnabled(), goog.ime.lang.InputTool.get(e.getInputTool()))
};
goog.ime.api.ita.InputToolsController.prototype.onTiaMenuBind_ = function $goog$ime$api$ita$InputToolsController$$onTiaMenuBind_$(e) {
  var element = e.getElement();
  this.inputToolManager_.activeElement = element;
  goog.array.contains(this.pageElements_, element) || (this.pageElements_.push(element), this.inputMethod_.register([element]));
  this.inputMethod_.activateInputTool(this.inputToolManager_.currentInputTool, this.inputToolManager_.currentInputToolState)
};
goog.ime.api.ita.InputToolsController.prototype.onTiaMenuVisible_ = function $goog$ime$api$ita$InputToolsController$$onTiaMenuVisible_$(e) {
  var visible = e.getVisible(), inputTool = this.inputToolManager_.currentInputTool, enabled = this.inputToolManager_.currentInputToolState;
  inputTool && inputTool.type == goog.ime.lang.InputToolType.KBD && enabled && this.inputMethod_.execCommand(goog.ime.plugin.CommandType.SHOW_KEYBOARD, visible)
};
goog.ime.api.ita.InputToolsController.prototype.showControl = function $goog$ime$api$ita$InputToolsController$$showControl$(opt_config) {
  var inputTools = this.inputToolManager_.inputToolsInPage;
  goog.array.isEmpty(inputTools) && this.raiseError_("showControl", "No input tools for elements");
  var ui = goog.ime.api.ita.InputToolsController.UI.KENNEDY, isFloating = !1, container, inputElement;
  opt_config && (opt_config.ui && (ui = opt_config.ui), opt_config.isFloating && (isFloating = opt_config.isFloating), opt_config.container && (container = opt_config.container), opt_config.inputElement && (inputElement = opt_config.inputElement));
  var menu = this.createMenu_(ui);
  if(!menu) {
    return null
  }
  menu.addEventListener(goog.ime.api.ita.MenuEventType.ACTION, goog.bind(this.onTiaMenuAction_, this));
  menu.addEventListener(goog.ime.api.ita.MenuEventType.BIND, goog.bind(this.onTiaMenuBind_, this));
  menu.addEventListener(goog.ime.api.ita.MenuEventType.VISIBILITY, goog.bind(this.onTiaMenuVisible_, this));
  menu.renderSelf(isFloating, container);
  menu.bindElement(inputElement);
  return menu
};
goog.ime.api.ita.InputToolsController.prototype.createMenu_ = function $goog$ime$api$ita$InputToolsController$$createMenu_$(ui) {
  var menu = null;
  ui == goog.ime.api.ita.InputToolsController.UI.KENNEDY && (menu = new goog.ime.api.ita.KennedyMenu(this.inputToolManager_, this.eventTarget_));
  menu && (goog.exportProperty(menu, "bindElement", menu.bindElement), goog.exportProperty(menu, "reposition", menu.reposition), goog.exportProperty(menu, "show", menu.show), goog.exportProperty(menu, "hide", menu.hide), goog.exportProperty(menu, "toggle", menu.toggle), goog.exportProperty(menu, "resize", menu.resize));
  return menu
};
goog.ime.api.ita.InputToolsController.prototype.getCurrentInputTool = function $goog$ime$api$ita$InputToolsController$$getCurrentInputTool$() {
  var name = this.inputToolManager_.currentInputTool.code, state = this.inputToolManager_.currentInputToolState;
  return{name:name, state:state}
};
goog.ime.api.ita.InputToolsController.prototype.onKeyboardActionHandler_ = function $goog$ime$api$ita$InputToolsController$$onKeyboardActionHandler_$() {
  this.inputToolManager_.currentInputToolState = !1;
  this.eventTarget_.dispatchEvent({type:goog.ime.api.ita.ControlEventType.CURRENT_INPUT_TOOL_CHANGED, prevInputToolName:this.inputToolManager_.currentInputTool.code, prevInputToolActive:this.inputToolManager_.currentInputToolState, currInputToolName:this.inputToolManager_.currentInputTool.code, currInputToolActive:!1})
};
goog.ime.api.ita.InputToolsController.prototype.setApplicationName = function $goog$ime$api$ita$InputToolsController$$setApplicationName$(applicationName) {
  goog.ime.plugin.lang.TranslitQuery.applicationName = applicationName
};
goog.ime.api.ita.InputToolsController.prototype.setAutoDirection = function $goog$ime$api$ita$InputToolsController$$setAutoDirection$(autoDirection) {
  this.inputMethod_.setAutoDirection(autoDirection)
};
goog.ime.api.ita.InputToolsController.prototype.onExecuteCommand_ = function $goog$ime$api$ita$InputToolsController$$onExecuteCommand_$(e) {
  var args = [e.command];
  e.var_args && goog.array.extend(args, e.var_args);
  this.inputMethod_.execCommand.apply(this.inputMethod_, args)
};
goog.ime.api.ita.InputToolsController.prototype.onFocus_ = function $goog$ime$api$ita$InputToolsController$$onFocus_$(e) {
  this.inputToolManager_.activeElement = e.target
};
goog.ime.api.ita.InputToolsController.prototype.disposeInternal = function $goog$ime$api$ita$InputToolsController$$disposeInternal$() {
  goog.ime.api.ita.InputToolsController.superClass_.disposeInternal.call(this);
  this.statusBar_ && this.statusBar_.dispose();
  this.pageElements_ = this.statusBar_ = null;
  this.eventTarget_.dispose();
  this.inputToolManager_ = null;
  this.eventRegister.dispose();
  this.inputMethod_.dispose();
  this.obsoletePageElements_ = null
};
goog.ime.api.ita.expose = {};
goog.ime.api.ita.expose.dummy = function $goog$ime$api$ita$expose$dummy$() {
};
var INPUT_TOOL_CODE_SYMBOL = {INPUTMETHOD_TRANSLITERATION_AMHARIC:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_AMHARIC, INPUTMETHOD_TRANSLITERATION_ARABIC:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_ARABIC, INPUTMETHOD_TRANSLITERATION_BENGALI:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_BENGALI, INPUTMETHOD_PINYIN_CHINESE_SIMPLIFIED:goog.ime.lang.InputToolCode.INPUTMETHOD_PINYIN_CHINESE_SIMPLIFIED, INPUTMETHOD_PINYIN_CHINESE_TRADITIONAL:goog.ime.lang.InputToolCode.INPUTMETHOD_PINYIN_CHINESE_TRADITIONAL, 
INPUTMETHOD_WUBI_CHINESE_SIMPLIFIED:goog.ime.lang.InputToolCode.INPUTMETHOD_WUBI_CHINESE_SIMPLIFIED, INPUTMETHOD_ZHUYIN_CHINESE_TRADITIONAL:goog.ime.lang.InputToolCode.INPUTMETHOD_ZHUYIN_CHINESE_TRADITIONAL, INPUTMETHOD_TRANSLITERATION_GREEK:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_GREEK, INPUTMETHOD_TRANSLITERATION_GUJARATI:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_GUJARATI, INPUTMETHOD_TRANSLITERATION_HEBREW:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HEBREW, 
INPUTMETHOD_TRANSLITERATION_HINDI:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_HINDI, INPUTMETHOD_TRANSLITERATION_JAPANESE:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_JAPANESE, INPUTMETHOD_TRANSLITERATION_KANNADA:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_KANNADA, INPUTMETHOD_TRANSLITERATION_MALAYALAM:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_MALAYALAM, INPUTMETHOD_TRANSLITERATION_MARATHI:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_MARATHI, 
INPUTMETHOD_TRANSLITERATION_NEPALI:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_NEPALI, INPUTMETHOD_TRANSLITERATION_ORIYA:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_ORIYA, INPUTMETHOD_TRANSLITERATION_PERSIAN:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_PERSIAN, INPUTMETHOD_TRANSLITERATION_PUNJABI:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_PUNJABI, INPUTMETHOD_TRANSLITERATION_RUSSIAN:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_RUSSIAN, INPUTMETHOD_TRANSLITERATION_SANSKRIT:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_SANSKRIT, 
INPUTMETHOD_TRANSLITERATION_SERBIAN:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_SERBIAN, INPUTMETHOD_TRANSLITERATION_SINHALESE:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_SINHALESE, INPUTMETHOD_TRANSLITERATION_TAMIL:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_TAMIL, INPUTMETHOD_TRANSLITERATION_TELUGU:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_TELUGU, INPUTMETHOD_TRANSLITERATION_TIGRINYA:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_TIGRINYA, 
INPUTMETHOD_TRANSLITERATION_URDU:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_URDU, INPUTMETHOD_TRANSLITERATION_VIETNAMESE:goog.ime.lang.InputToolCode.INPUTMETHOD_TRANSLITERATION_VIETNAMESE, KEYBOARD_ALBANIAN:goog.ime.lang.InputToolCode.KEYBOARD_ALBANIAN, KEYBOARD_ARABIC:goog.ime.lang.InputToolCode.KEYBOARD_ARABIC, KEYBOARD_ARMENIAN_EASTERN:goog.ime.lang.InputToolCode.KEYBOARD_ARMENIAN_EASTERN, KEYBOARD_ARMENIAN_WESTERN:goog.ime.lang.InputToolCode.KEYBOARD_ARMENIAN_WESTERN, KEYBOARD_BASQUE:goog.ime.lang.InputToolCode.KEYBOARD_BASQUE, 
KEYBOARD_BELARUSIAN:goog.ime.lang.InputToolCode.KEYBOARD_BELARUSIAN, KEYBOARD_BENGALI_INSCRIPT:goog.ime.lang.InputToolCode.KEYBOARD_BENGALI_INSCRIPT, KEYBOARD_BENGALI_PHONETIC:goog.ime.lang.InputToolCode.KEYBOARD_BENGALI_PHONETIC, KEYBOARD_BOSNIAN:goog.ime.lang.InputToolCode.KEYBOARD_BOSNIAN, KEYBOARD_BRAZILIAN_PORTUGUESE:goog.ime.lang.InputToolCode.KEYBOARD_BRAZILIAN_PORTUGUESE, KEYBOARD_BULGARIAN:goog.ime.lang.InputToolCode.KEYBOARD_BULGARIAN, KEYBOARD_BULGARIAN_PHONETIC:goog.ime.lang.InputToolCode.KEYBOARD_BULGARIAN_PHONETIC, 
KEYBOARD_CATALAN:goog.ime.lang.InputToolCode.KEYBOARD_CATALAN, KEYBOARD_CHEROKEE:goog.ime.lang.InputToolCode.KEYBOARD_CHEROKEE, KEYBOARD_CROATIAN:goog.ime.lang.InputToolCode.KEYBOARD_CROATIAN, KEYBOARD_CZECH:goog.ime.lang.InputToolCode.KEYBOARD_CZECH, KEYBOARD_CZECH_QWERTZ:goog.ime.lang.InputToolCode.KEYBOARD_CZECH_QWERTZ, KEYBOARD_DANISH:goog.ime.lang.InputToolCode.KEYBOARD_DANISH, KEYBOARD_DARI:goog.ime.lang.InputToolCode.KEYBOARD_DARI, KEYBOARD_DUTCH:goog.ime.lang.InputToolCode.KEYBOARD_DUTCH, 
KEYBOARD_DEVANAGARI_PHONETIC:goog.ime.lang.InputToolCode.KEYBOARD_DEVANAGARI_PHONETIC, KEYBOARD_ENGLISH:goog.ime.lang.InputToolCode.KEYBOARD_ENGLISH, KEYBOARD_ESTONIAN:goog.ime.lang.InputToolCode.KEYBOARD_ESTONIAN, KEYBOARD_ETHIOPIC:goog.ime.lang.InputToolCode.KEYBOARD_ETHIOPIC, KEYBOARD_FINNISH:goog.ime.lang.InputToolCode.KEYBOARD_FINNISH, KEYBOARD_FRENCH:goog.ime.lang.InputToolCode.KEYBOARD_FRENCH, KEYBOARD_GALICIAN:goog.ime.lang.InputToolCode.KEYBOARD_GALICIAN, KEYBOARD_GEORGIAN_QWERTY:goog.ime.lang.InputToolCode.KEYBOARD_GEORGIAN_QWERTY, 
KEYBOARD_GEORGIAN_TYPEWRITER:goog.ime.lang.InputToolCode.KEYBOARD_GEORGIAN_TYPEWRITER, KEYBOARD_GERMAN:goog.ime.lang.InputToolCode.KEYBOARD_GERMAN, KEYBOARD_GREEK:goog.ime.lang.InputToolCode.KEYBOARD_GREEK, KEYBOARD_GUJARATI_INSCRIPT:goog.ime.lang.InputToolCode.KEYBOARD_GUJARATI_INSCRIPT, KEYBOARD_GUJARATI_PHONETIC:goog.ime.lang.InputToolCode.KEYBOARD_GUJARATI_PHONETIC, KEYBOARD_GURMUKHI_INSCRIPT:goog.ime.lang.InputToolCode.KEYBOARD_GURMUKHI_INSCRIPT, KEYBOARD_GURMUKHI_PHONETIC:goog.ime.lang.InputToolCode.KEYBOARD_GURMUKHI_PHONETIC, 
KEYBOARD_HEBREW:goog.ime.lang.InputToolCode.KEYBOARD_HEBREW, KEYBOARD_HINDI:goog.ime.lang.InputToolCode.KEYBOARD_HINDI, KEYBOARD_HUNGARIAN_101:goog.ime.lang.InputToolCode.KEYBOARD_HUNGARIAN_101, KEYBOARD_ICELANDIC:goog.ime.lang.InputToolCode.KEYBOARD_ICELANDIC, KEYBOARD_ITALIAN:goog.ime.lang.InputToolCode.KEYBOARD_ITALIAN, KEYBOARD_KANNADA_INSCRIPT:goog.ime.lang.InputToolCode.KEYBOARD_KANNADA_INSCRIPT, KEYBOARD_KANNADA_PHONETIC:goog.ime.lang.InputToolCode.KEYBOARD_KANNADA_PHONETIC, KEYBOARD_KAZAKH:goog.ime.lang.InputToolCode.KEYBOARD_KAZAKH, 
KEYBOARD_KHMER:goog.ime.lang.InputToolCode.KEYBOARD_KHMER, KEYBOARD_KOREAN:goog.ime.lang.InputToolCode.KEYBOARD_KOREAN, KEYBOARD_KYRGYZ:goog.ime.lang.InputToolCode.KEYBOARD_KYRGYZ, KEYBOARD_LAO:goog.ime.lang.InputToolCode.KEYBOARD_LAO, KEYBOARD_LATVIAN:goog.ime.lang.InputToolCode.KEYBOARD_LATVIAN, KEYBOARD_LITHUANIAN:goog.ime.lang.InputToolCode.KEYBOARD_LITHUANIAN, KEYBOARD_MACEDONIAN:goog.ime.lang.InputToolCode.KEYBOARD_MACEDONIAN, KEYBOARD_MALAYALAM_INSCRIPT:goog.ime.lang.InputToolCode.KEYBOARD_MALAYALAM_INSCRIPT, 
KEYBOARD_MALAYALAM_PHONETIC:goog.ime.lang.InputToolCode.KEYBOARD_MALAYALAM_PHONETIC, KEYBOARD_MALTESE:goog.ime.lang.InputToolCode.KEYBOARD_MALTESE, KEYBOARD_MAORI:goog.ime.lang.InputToolCode.KEYBOARD_MAORI, KEYBOARD_MONGOLIAN_CYRILLIC:goog.ime.lang.InputToolCode.KEYBOARD_MONGOLIAN_CYRILLIC, KEYBOARD_MONTENEGRIN:goog.ime.lang.InputToolCode.KEYBOARD_MONTENEGRIN, KEYBOARD_NORWEGIAN:goog.ime.lang.InputToolCode.KEYBOARD_NORWEGIAN, KEYBOARD_ORIYA_INSCRIPT:goog.ime.lang.InputToolCode.KEYBOARD_ORIYA_INSCRIPT, 
KEYBOARD_ORIYA_PHONETIC:goog.ime.lang.InputToolCode.KEYBOARD_ORIYA_PHONETIC, KEYBOARD_PAN_AFRICA_LATIN:goog.ime.lang.InputToolCode.KEYBOARD_PAN_AFRICA_LATIN, KEYBOARD_PASHTO:goog.ime.lang.InputToolCode.KEYBOARD_PASHTO, KEYBOARD_PERSIAN:goog.ime.lang.InputToolCode.KEYBOARD_PERSIAN, KEYBOARD_POLISH:goog.ime.lang.InputToolCode.KEYBOARD_POLISH, KEYBOARD_PORTUGUESE:goog.ime.lang.InputToolCode.KEYBOARD_PORTUGUESE, KEYBOARD_ROMANI:goog.ime.lang.InputToolCode.KEYBOARD_ROMANI, KEYBOARD_ROMANIAN:goog.ime.lang.InputToolCode.KEYBOARD_ROMANIAN, 
KEYBOARD_ROMANIAN_SR13392_PRIMARY:goog.ime.lang.InputToolCode.KEYBOARD_ROMANIAN_SR13392_PRIMARY, KEYBOARD_ROMANIAN_SR13392_SECONDARY:goog.ime.lang.InputToolCode.KEYBOARD_ROMANIAN_SR13392_SECONDARY, KEYBOARD_RUSSIAN:goog.ime.lang.InputToolCode.KEYBOARD_RUSSIAN, KEYBOARD_SANSKRIT_PHONETIC:goog.ime.lang.InputToolCode.KEYBOARD_SANSKRIT_PHONETIC, KEYBOARD_SERBIAN_CYRILLIC:goog.ime.lang.InputToolCode.KEYBOARD_SERBIAN_CYRILLIC, KEYBOARD_SERBIAN_LATIN:goog.ime.lang.InputToolCode.KEYBOARD_SERBIAN_LATIN, KEYBOARD_SINHALA:goog.ime.lang.InputToolCode.KEYBOARD_SINHALA, 
KEYBOARD_SLOVAK:goog.ime.lang.InputToolCode.KEYBOARD_SLOVAK, KEYBOARD_SLOVAK_QWERTY:goog.ime.lang.InputToolCode.KEYBOARD_SLOVAK_QWERTY, KEYBOARD_SLOVENIAN:goog.ime.lang.InputToolCode.KEYBOARD_SLOVENIAN, KEYBOARD_SOUTHERN_UZBEK:goog.ime.lang.InputToolCode.KEYBOARD_SOUTHERN_UZBEK, KEYBOARD_SPANISH:goog.ime.lang.InputToolCode.KEYBOARD_SPANISH, KEYBOARD_SWEDISH:goog.ime.lang.InputToolCode.KEYBOARD_SWEDISH, KEYBOARD_SWISS_GERMAN:goog.ime.lang.InputToolCode.KEYBOARD_SWISS_GERMAN, KEYBOARD_TAMIL_99:goog.ime.lang.InputToolCode.KEYBOARD_TAMIL_99, 
KEYBOARD_TAMIL_INSCRIPT:goog.ime.lang.InputToolCode.KEYBOARD_TAMIL_INSCRIPT, KEYBOARD_TAMIL_PHONETIC:goog.ime.lang.InputToolCode.KEYBOARD_TAMIL_PHONETIC, KEYBOARD_TATAR:goog.ime.lang.InputToolCode.KEYBOARD_TATAR, KEYBOARD_TELUGU_INSCRIPT:goog.ime.lang.InputToolCode.KEYBOARD_TELUGU_INSCRIPT, KEYBOARD_TELUGU_PHONETIC:goog.ime.lang.InputToolCode.KEYBOARD_TELUGU_PHONETIC, KEYBOARD_THAI:goog.ime.lang.InputToolCode.KEYBOARD_THAI, KEYBOARD_TURKISH_F:goog.ime.lang.InputToolCode.KEYBOARD_TURKISH_F, KEYBOARD_TURKISH_Q:goog.ime.lang.InputToolCode.KEYBOARD_TURKISH_Q, 
KEYBOARD_UIGHUR:goog.ime.lang.InputToolCode.KEYBOARD_UIGHUR, KEYBOARD_UKRAINIAN_101:goog.ime.lang.InputToolCode.KEYBOARD_UKRAINIAN_101, KEYBOARD_URDU:goog.ime.lang.InputToolCode.KEYBOARD_URDU, KEYBOARD_UZBEK_LATIN:goog.ime.lang.InputToolCode.KEYBOARD_UZBEK_LATIN, KEYBOARD_UZBEK_CYRILLIC_PHONETIC:goog.ime.lang.InputToolCode.KEYBOARD_UZBEK_CYRILLIC_PHONETIC, KEYBOARD_UZBEK_CYRILLIC_TYPEWRITTER:goog.ime.lang.InputToolCode.KEYBOARD_UZBEK_CYRILLIC_TYPEWRITTER, KEYBOARD_VIETNAMESE_TCVN:goog.ime.lang.InputToolCode.KEYBOARD_VIETNAMESE_TCVN, 
KEYBOARD_VIETNAMESE_TELEX:goog.ime.lang.InputToolCode.KEYBOARD_VIETNAMESE_TELEX, KEYBOARD_VIETNAMESE_VIQR:goog.ime.lang.InputToolCode.KEYBOARD_VIETNAMESE_VIQR};
goog.exportSymbol("google.elements.inputtools.InputToolsController", goog.ime.api.ita.InputToolsController);
var tiaControllerPrototype$$inline_111 = goog.ime.api.ita.InputToolsController.prototype;
goog.exportProperty(tiaControllerPrototype$$inline_111, "addInputTools", tiaControllerPrototype$$inline_111.addInputTools);
goog.exportProperty(tiaControllerPrototype$$inline_111, "removeInputTools", tiaControllerPrototype$$inline_111.removeInputTools);
goog.exportProperty(tiaControllerPrototype$$inline_111, "setInputTools", tiaControllerPrototype$$inline_111.setInputTools);
goog.exportProperty(tiaControllerPrototype$$inline_111, "activateInputTool", tiaControllerPrototype$$inline_111.activateInputTool);
goog.exportProperty(tiaControllerPrototype$$inline_111, "showControl", tiaControllerPrototype$$inline_111.showControl);
goog.exportProperty(tiaControllerPrototype$$inline_111, "addPageElements", tiaControllerPrototype$$inline_111.addPageElements);
goog.exportProperty(tiaControllerPrototype$$inline_111, "removePageElements", tiaControllerPrototype$$inline_111.removePageElements);
goog.exportProperty(tiaControllerPrototype$$inline_111, "setPageElements", tiaControllerPrototype$$inline_111.setPageElements);
goog.exportProperty(tiaControllerPrototype$$inline_111, "setAutoDirection", tiaControllerPrototype$$inline_111.setAutoDirection);
goog.exportProperty(tiaControllerPrototype$$inline_111, "getCurrentInputTool", tiaControllerPrototype$$inline_111.getCurrentInputTool);
goog.exportProperty(tiaControllerPrototype$$inline_111, "enableCurrentInputTool", tiaControllerPrototype$$inline_111.enableCurrentInputTool);
goog.exportProperty(tiaControllerPrototype$$inline_111, "disableCurrentInputTool", tiaControllerPrototype$$inline_111.disableCurrentInputTool);
goog.exportProperty(tiaControllerPrototype$$inline_111, "toggleCurrentInputTool", tiaControllerPrototype$$inline_111.toggleCurrentInputTool);
goog.exportProperty(tiaControllerPrototype$$inline_111, "addEventListener", tiaControllerPrototype$$inline_111.addEventListener);
goog.exportProperty(tiaControllerPrototype$$inline_111, "removeEventListener", tiaControllerPrototype$$inline_111.removeEventListener);
goog.exportProperty(tiaControllerPrototype$$inline_111, "setApplicationName", tiaControllerPrototype$$inline_111.setApplicationName);
var eventType$$inline_112 = {INPUT_TOOL_ENABLED:goog.ime.api.ita.ControlEventType.CURRENT_INPUT_TOOL_CHANGED, INPUT_TOOL_LIST_UPDATED:goog.ime.api.ita.ControlEventType.INPUT_TOOL_LIST_UPDATED, PAGE_ELEMENT_LIST_UPDATED:goog.ime.api.ita.ControlEventType.PAGE_ELEMENT_LIST_UPDATED};
goog.exportSymbol("google.elements.inputtools.InputToolNativeCaption", goog.ime.api.ita.InputToolInfo.INPUT_TOOL_NAME);
goog.exportSymbol("google.elements.inputtools.EventType", eventType$$inline_112);
goog.exportSymbol("google.elements.inputtools.PositionType", goog.ime.api.ita.AbstractMenu.PositionType);
var uiType$$inline_113 = {CLASSIC:goog.ime.api.ita.InputToolsController.UI.KENNEDY};
goog.exportSymbol("google.elements.inputtools.UiType", uiType$$inline_113);
goog.exportSymbol("google_input_tools_source", goog.ime.api.ita.InputToolsController.BUILD_SOURCE);
goog.exportSymbol("google.elements.inputtools.InputToolCode", INPUT_TOOL_CODE_SYMBOL);
if(window.jstiming) {
  window.jstiming.beaconImageReferences_ = {};
  window.jstiming.reportCounter_ = 1;
  var getTick = function $getTick$(timer, label, opt_start) {
    var tick = timer.t[label], start = timer.t.start;
    if(tick && (start || opt_start)) {
      return tick = timer.t[label][0], start = void 0 != opt_start ? opt_start : start[0], tick - start
    }
  }, getReportUri = function $getReportUri$(timer, opt_extraParams, opt_reportUri) {
    var extra = "";
    window.jstiming.pt && (extra += "&srt=" + window.jstiming.pt, delete window.jstiming.pt);
    try {
      window.external && window.external.tran ? extra += "&tran=" + window.external.tran : window.gtbExternal && window.gtbExternal.tran ? extra += "&tran=" + window.gtbExternal.tran() : window.chrome && window.chrome.csi && (extra += "&tran=" + window.chrome.csi().tran)
    }catch(e) {
    }
    var chrome = window.chrome;
    if(chrome) {
      var loadTimes = chrome.loadTimes;
      if(loadTimes) {
        loadTimes().wasFetchedViaSpdy && (extra += "&p=s");
        if(loadTimes().wasNpnNegotiated) {
          var extra = extra + "&npn=1", protocol = loadTimes().npnNegotiatedProtocol;
          protocol && (extra += "&npnv=" + (encodeURIComponent || escape)(protocol))
        }
        loadTimes().wasAlternateProtocolAvailable && (extra += "&apa=1")
      }
    }
    var ticks = timer.t, start = ticks.start, rt = [], it = [], label;
    for(label in ticks) {
      if("start" != label && 0 != label.indexOf("_")) {
        var relative_label = ticks[label][1];
        relative_label ? ticks[relative_label] && it.push(label + "." + getTick(timer, label, ticks[relative_label][0])) : start && rt.push(label + "." + getTick(timer, label))
      }
    }
    delete ticks.start;
    if(opt_extraParams) {
      for(var arg in opt_extraParams) {
        extra += "&" + arg + "=" + opt_extraParams[arg]
      }
    }
    var reportUri = opt_reportUri;
    reportUri || (reportUri = "https:" == document.location.protocol ? "https://csi.gstatic.com/csi" : "http://csi.gstatic.com/csi");
    var uri = [reportUri, "?v=3", "&s=" + (window.jstiming.sn || "i18n_input") + "&action=", timer.name, it.length ? "&it=" + it.join(",") : "", "", extra, "&rt=", rt.join(",")].join("");
    return uri
  }, sendReport_ = function $sendReport_$(timer, opt_extraParams, opt_reportUri) {
    var uri = getReportUri(timer, opt_extraParams, opt_reportUri);
    if(!uri) {
      return""
    }
    var img = new Image, id = window.jstiming.reportCounter_++;
    window.jstiming.beaconImageReferences_[id] = img;
    img.onload = img.onerror = function $img$onerror$() {
      window.jstiming && delete window.jstiming.beaconImageReferences_[id]
    };
    img.src = uri;
    img = null;
    return uri
  };
  window.jstiming.report = function $window$jstiming$report$(timer, opt_extraParams, opt_reportUri) {
    if("prerender" == document.webkitVisibilityState) {
      var visibilityChange = "webkitvisibilitychange", listener_executed = !1, listener = function $listener$() {
        if(!listener_executed) {
          opt_extraParams ? opt_extraParams.prerender = "1" : opt_extraParams = {prerender:"1"};
          var JSCompiler_inline_result;
          "prerender" == document.webkitVisibilityState ? JSCompiler_inline_result = !1 : (sendReport_(timer, opt_extraParams, opt_reportUri), JSCompiler_inline_result = !0);
          JSCompiler_inline_result && (listener_executed = !0, document.removeEventListener(visibilityChange, listener, !1))
        }
      };
      document.addEventListener(visibilityChange, listener, !1);
      return""
    }
    return sendReport_(timer, opt_extraParams, opt_reportUri)
  }
}
;})();
